RE: [PATCH 3/3] qla2x00: fix init error handling

2018-03-08 Thread Meelis Roos
> Hi Meelis,
> 
> This issue should already be addressed by a very recent commit:
> 
> 6a2cf8d3663e13e1 scsi: qla2xxx: Fix crashes in qla2x00_probe_one on probe 
> failure

What tree is that commit in?

-- 
Meelis Roos (mr...@linux.ee)


RE: [PATCH 3/3] qla2x00: fix init error handling

2018-03-08 Thread Meelis Roos
> Hi Meelis,
> 
> This issue should already be addressed by a very recent commit:
> 
> 6a2cf8d3663e13e1 scsi: qla2xxx: Fix crashes in qla2x00_probe_one on probe 
> failure

Good, will test.

> Furthermore, the additions in qla2x00_remove_one of:
> 
> + qla2x00_mem_free(ha);
> +
> + qla2x00_free_queues(ha);
> +
> 
> are unnecessary. These routines are already called by qla2x00_free_device 
> just above
> in qla2x00_remove_one.

No, that was the point of my changes - they must not be called from 
qla2x00_free_device or they will be double freed in some cases.


-- 
Meelis Roos (mr...@linux.ee)


RE: [PATCH 3/3] qla2x00: fix init error handling

2018-03-08 Thread Kuzeja, William
On Thu, Mar 08, 2018 at 08:45:25AM, Meelis Roos wrote:
> When firmware init fails, qla2x00_probe_one() does double free of req and rsp
> queues and possibly other structures allocated by qla2x00_mem_alloc().

> Fix it by pulling out qla2x00_mem_free() and qla2x00_free_queues() invocations
> from qla2x00_free_device() and call them manually where needed, and also zero
> the req and rsp pointers after freeing them once in the error handler of
> qla2x00_probe_one().

> This fixes memory corruption and further crashes in unrelated code when 
> qla2200
> init fails for some reason.

> Signed-off-by: Meelis Roos 

Hi Meelis,

This issue should already be addressed by a very recent commit:

6a2cf8d3663e13e1 scsi: qla2xxx: Fix crashes in qla2x00_probe_one on probe 
failure

Furthermore, the additions in qla2x00_remove_one of:

+   qla2x00_mem_free(ha);
+
+   qla2x00_free_queues(ha);
+

are unnecessary. These routines are already called by qla2x00_free_device just 
above
in qla2x00_remove_one.

Regards,

   -bk