Re: [PATCH 02/43] qla2xxx: Fix NULL pointer access for fcport structure

2017-12-20 Thread Madhani, Himanshu

> On Dec 20, 2017, at 10:26 AM, Bart Van Assche  wrote:
> 
> On Tue, 2017-12-19 at 22:56 -0800, Himanshu Madhani wrote:
>> From: Quinn Tran 
>> 
>> when preocessing iocb in a timeout case, driver was trying to log messages
>   ^^^
>   processing?
> 
> Bart.

Will fix in v2 of the series

Thanks,
- Himanshu



Re: [PATCH 02/43] qla2xxx: Fix NULL pointer access for fcport structure

2017-12-20 Thread Bart Van Assche
On Tue, 2017-12-19 at 22:56 -0800, Himanshu Madhani wrote:
> From: Quinn Tran 
> 
> when preocessing iocb in a timeout case, driver was trying to log messages
   ^^^
   processing?

Bart.

[PATCH 02/43] qla2xxx: Fix NULL pointer access for fcport structure

2017-12-19 Thread Himanshu Madhani
From: Quinn Tran 

when preocessing iocb in a timeout case, driver was trying to log messages
without verifying if the fcport structure could have valid data. This
results in a NULL pointer access.

Fixes: 726b85487067("qla2xxx: Add framework for async fabric discovery")
Signed-off-by: Quinn Tran 
Signed-off-by: Himanshu Madhani 
---
 drivers/scsi/qla2xxx/qla_init.c | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 7fa71170d6ff..9d65fbe85e30 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -102,11 +102,16 @@ qla2x00_async_iocb_timeout(void *data)
struct srb_iocb *lio = >u.iocb_cmd;
struct event_arg ea;
 
-   ql_dbg(ql_dbg_disc, fcport->vha, 0x2071,
-   "Async-%s timeout - hdl=%x portid=%06x %8phC.\n",
-   sp->name, sp->handle, fcport->d_id.b24, fcport->port_name);
+   if (fcport) {
+   ql_dbg(ql_dbg_disc, fcport->vha, 0x2071,
+   "Async-%s timeout - hdl=%x portid=%06x %8phC.\n",
+   sp->name, sp->handle, fcport->d_id.b24, fcport->port_name);
 
-   fcport->flags &= ~FCF_ASYNC_SENT;
+   fcport->flags &= ~FCF_ASYNC_SENT;
+   } else {
+   pr_info("Async-%s timeout - hdl=%x.\n",
+   sp->name, sp->handle);
+   }
 
switch (sp->type) {
case SRB_LOGIN_CMD:
-- 
2.12.0