diff options
author | Jitendra Bhivare <jitendra.bhivare@broadcom.com> | 2016-08-26 11:39:07 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-08-31 04:25:48 +0200 |
commit | bf9b7554f46c4736d72e61f076a2d91a4303d2ea (patch) | |
tree | 1464d816b46191d8b102466b78474007901616db /drivers/scsi/be2iscsi/be_main.c | |
parent | scsi: be2iscsi: Fix error return code (diff) | |
download | linux-bf9b7554f46c4736d72e61f076a2d91a4303d2ea.tar.xz linux-bf9b7554f46c4736d72e61f076a2d91a4303d2ea.zip |
scsi: be2iscsi: Remove redundant iscsi_wrb desc memset
alloc_wrb_handle already does memset zero of iscsi_wrb descriptor so
remove redundant memset in WRB submission paths.
Add pwrb_handle NULL check before memsett'ing pwrb.
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/be2iscsi/be_main.c')
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index b30db877972c..6a6906f847db 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c @@ -967,7 +967,9 @@ beiscsi_get_wrb_handle(struct hwi_wrb_context *pwrb_context, else pwrb_context->alloc_index++; spin_unlock_bh(&pwrb_context->wrb_lock); - memset(pwrb_handle->pwrb, 0, sizeof(*pwrb_handle->pwrb)); + + if (pwrb_handle) + memset(pwrb_handle->pwrb, 0, sizeof(*pwrb_handle->pwrb)); return pwrb_handle; } @@ -4718,7 +4720,6 @@ static int beiscsi_mtask(struct iscsi_task *task) cid = beiscsi_conn->beiscsi_conn_cid; pwrb = io_task->pwrb_handle->pwrb; - memset(pwrb, 0, sizeof(*pwrb)); if (is_chip_be2_be3r(phba)) { AMAP_SET_BITS(struct amap_iscsi_wrb, cmdsn_itt, pwrb, |