History

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley: "Four small fixes, three in drivers with the core one adding a batch indicator (for drivers which use it) to the error handler" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ufs: core: Let the sq_lock protect sq_tail_slot access scsi: ufs: qcom: Return ufs_qcom_clk_scale_*() errors in ufs_qcom_clk_scale_notify() scsi: core: Always send batch on reset or error handling command scsi: bnx2fc: Fix skb double free in bnx2fc_rcv()

Linus Torvalds committed 2 years ago

Commit f969c912 parents 4b2ee6d 04c116e4 files · +11 −9Browse files

Unified · Split

4 files
  1. drivers/scsi/bnx2fc/bnx2fc_fcoe.c +3 −6
  2. drivers/scsi/scsi_error.c +2 −0
  3. drivers/ufs/core/ufshcd.c +2 −1
  4. drivers/ufs/host/ufs-qcom.c +4 −2
drivers/scsi/bnx2fc/bnx2fc_fcoe.c+3−6
@@ -429,7 +429,6 @@ static int bnx2fc_rcv(struct sk_buff *skb, struct net_device *dev, · 428 unmodified lines
429429 struct fcoe_ctlr *ctlr;
430430 struct fcoe_rcv_info *fr;
431431 struct fcoe_percpu_s *bg;
432− struct sk_buff *tmp_skb;
433432
434433 interface = container_of(ptype, struct bnx2fc_interface,
435434 fcoe_packet_type);
@@ -441,11 +440,9 @@ static int bnx2fc_rcv(struct sk_buff *skb, struct net_device *dev, · 5 unmodified lines
441440 goto err;
442441 }
443442
444− tmp_skb = skb_share_check(skb, GFP_ATOMIC);
445− if (!tmp_skb)
446− goto err;
447−
448− skb = tmp_skb;
443+ skb = skb_share_check(skb, GFP_ATOMIC);
444+ if (!skb)
445+ return -1;
449446
450447 if (unlikely(eth_hdr(skb)->h_proto != htons(ETH_P_FCOE))) {
451448 printk(KERN_ERR PFX "bnx2fc_rcv: Wrong FC type frame\n");
drivers/scsi/scsi_error.c+2−0
@@ -1152,6 +1152,7 @@ retry: · 1151 unmodified lines
11521152
11531153 scsi_log_send(scmd);
11541154 scmd->submitter = SUBMITTED_BY_SCSI_ERROR_HANDLER;
1155+ scmd->flags |= SCMD_LAST;
11551156
11561157 /*
11571158 * Lock sdev->state_mutex to avoid that scsi_device_quiesce() can
@@ -2459,6 +2460,7 @@ scsi_ioctl_reset(struct scsi_device *dev, int __user *arg) · 1301 unmodified lines
24592460 scsi_init_command(dev, scmd);
24602461
24612462 scmd->submitter = SUBMITTED_BY_SCSI_RESET_IOCTL;
2463+ scmd->flags |= SCMD_LAST;
24622464 memset(&scmd->sdb, 0, sizeof(scmd->sdb));
24632465
24642466 scmd->cmd_len = 0;
drivers/ufs/core/ufshcd.c+2−1
@@ -2274,9 +2274,10 @@ void ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag, · 2273 unmodified lines
22742274 if (is_mcq_enabled(hba)) {
22752275 int utrd_size = sizeof(struct utp_transfer_req_desc);
22762276 struct utp_transfer_req_desc *src = lrbp->utr_descriptor_ptr;
2277− struct utp_transfer_req_desc *dest = hwq->sqe_base_addr + hwq->sq_tail_slot;
2277+ struct utp_transfer_req_desc *dest;
22782278
22792279 spin_lock(&hwq->sq_lock);
2280+ dest = hwq->sqe_base_addr + hwq->sq_tail_slot;
22802281 memcpy(dest, src, utrd_size);
22812282 ufshcd_inc_sq_tail(hwq);
22822283 spin_unlock(&hwq->sq_lock);
drivers/ufs/host/ufs-qcom.c+4−2
@@ -1516,9 +1516,11 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba, · 1515 unmodified lines
15161516 err = ufs_qcom_clk_scale_up_pre_change(hba);
15171517 else
15181518 err = ufs_qcom_clk_scale_down_pre_change(hba);
1519− if (err)
1520− ufshcd_uic_hibern8_exit(hba);
15211519
1520+ if (err) {
1521+ ufshcd_uic_hibern8_exit(hba);
1522+ return err;
1523+ }
15221524 } else {
15231525 if (scale_up)
15241526 err = ufs_qcom_clk_scale_up_post_change(hba);