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()
Unified · Split
| @@ -429,7 +429,6 @@ static int bnx2fc_rcv(struct sk_buff *skb, struct net_device *dev, · 428 unmodified lines | |||
| 429 | struct fcoe_ctlr *ctlr; | 429 | struct fcoe_ctlr *ctlr; |
| 430 | struct fcoe_rcv_info *fr; | 430 | struct fcoe_rcv_info *fr; |
| 431 | struct fcoe_percpu_s *bg; | 431 | struct fcoe_percpu_s *bg; |
| 432 | struct sk_buff *tmp_skb; | ||
| 433 | 432 | ||
| 434 | interface = container_of(ptype, struct bnx2fc_interface, | 433 | interface = container_of(ptype, struct bnx2fc_interface, |
| 435 | fcoe_packet_type); | 434 | fcoe_packet_type); |
| @@ -441,11 +440,9 @@ static int bnx2fc_rcv(struct sk_buff *skb, struct net_device *dev, · 5 unmodified lines | |||
| 441 | goto err; | 440 | goto err; |
| 442 | } | 441 | } |
| 443 | 442 | ||
| 444 | tmp_skb = skb_share_check(skb, GFP_ATOMIC); | 443 | skb = skb_share_check(skb, GFP_ATOMIC); |
| 445 | if (!tmp_skb) | 444 | if (!skb) |
| 446 | goto err; | 445 | return -1; |
| 447 | |||
| 448 | skb = tmp_skb; | ||
| 449 | 446 | ||
| 450 | if (unlikely(eth_hdr(skb)->h_proto != htons(ETH_P_FCOE))) { | 447 | if (unlikely(eth_hdr(skb)->h_proto != htons(ETH_P_FCOE))) { |
| 451 | printk(KERN_ERR PFX "bnx2fc_rcv: Wrong FC type frame\n"); | 448 | printk(KERN_ERR PFX "bnx2fc_rcv: Wrong FC type frame\n"); |
| @@ -1152,6 +1152,7 @@ retry: · 1151 unmodified lines | |||
| 1152 | 1152 | ||
| 1153 | scsi_log_send(scmd); | 1153 | scsi_log_send(scmd); |
| 1154 | scmd->submitter = SUBMITTED_BY_SCSI_ERROR_HANDLER; | 1154 | scmd->submitter = SUBMITTED_BY_SCSI_ERROR_HANDLER; |
| 1155 | scmd->flags |= SCMD_LAST; | ||
| 1155 | 1156 | ||
| 1156 | /* | 1157 | /* |
| 1157 | * Lock sdev->state_mutex to avoid that scsi_device_quiesce() can | 1158 | * 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 | |||
| 2459 | scsi_init_command(dev, scmd); | 2460 | scsi_init_command(dev, scmd); |
| 2460 | 2461 | ||
| 2461 | scmd->submitter = SUBMITTED_BY_SCSI_RESET_IOCTL; | 2462 | scmd->submitter = SUBMITTED_BY_SCSI_RESET_IOCTL; |
| 2463 | scmd->flags |= SCMD_LAST; | ||
| 2462 | memset(&scmd->sdb, 0, sizeof(scmd->sdb)); | 2464 | memset(&scmd->sdb, 0, sizeof(scmd->sdb)); |
| 2463 | 2465 | ||
| 2464 | scmd->cmd_len = 0; | 2466 | scmd->cmd_len = 0; |
| @@ -2274,9 +2274,10 @@ void ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag, · 2273 unmodified lines | |||
| 2274 | if (is_mcq_enabled(hba)) { | 2274 | if (is_mcq_enabled(hba)) { |
| 2275 | int utrd_size = sizeof(struct utp_transfer_req_desc); | 2275 | int utrd_size = sizeof(struct utp_transfer_req_desc); |
| 2276 | struct utp_transfer_req_desc *src = lrbp->utr_descriptor_ptr; | 2276 | 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; |
| 2278 | 2278 | ||
| 2279 | spin_lock(&hwq->sq_lock); | 2279 | spin_lock(&hwq->sq_lock); |
| 2280 | dest = hwq->sqe_base_addr + hwq->sq_tail_slot; | ||
| 2280 | memcpy(dest, src, utrd_size); | 2281 | memcpy(dest, src, utrd_size); |
| 2281 | ufshcd_inc_sq_tail(hwq); | 2282 | ufshcd_inc_sq_tail(hwq); |
| 2282 | spin_unlock(&hwq->sq_lock); | 2283 | spin_unlock(&hwq->sq_lock); |
| @@ -1516,9 +1516,11 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba, · 1515 unmodified lines | |||
| 1516 | err = ufs_qcom_clk_scale_up_pre_change(hba); | 1516 | err = ufs_qcom_clk_scale_up_pre_change(hba); |
| 1517 | else | 1517 | else |
| 1518 | err = ufs_qcom_clk_scale_down_pre_change(hba); | 1518 | err = ufs_qcom_clk_scale_down_pre_change(hba); |
| 1519 | if (err) | ||
| 1520 | ufshcd_uic_hibern8_exit(hba); | ||
| 1521 | 1519 | ||
| 1520 | if (err) { | ||
| 1521 | ufshcd_uic_hibern8_exit(hba); | ||
| 1522 | return err; | ||
| 1523 | } | ||
| 1522 | } else { | 1524 | } else { |
| 1523 | if (scale_up) | 1525 | if (scale_up) |
| 1524 | err = ufs_qcom_clk_scale_up_post_change(hba); | 1526 | err = ufs_qcom_clk_scale_up_post_change(hba); |