* [PATCH] qedf: Fix NULL dereference in error handling
@ 2023-04-17 13:55 Jinhong Zhu
2023-04-25 3:41 ` Martin K. Petersen
2023-05-02 14:15 ` Jinhong Zhu
0 siblings, 2 replies; 5+ messages in thread
From: Jinhong Zhu @ 2023-04-17 13:55 UTC (permalink / raw)
To: Saurav Kashyap, Javed Hasan, GR-QLogic-Storage-Upstream,
James E.J. Bottomley, Martin K. Petersen, Jinhong Zhu
Cc: Dan Carpenter, linux-scsi, linux-kernel
Smatch reported:
drivers/scsi/qedf/qedf_main.c:3056 qedf_alloc_global_queues()
warn: missing unwind goto?
At this point in the function, nothing has been allocated so we can
return directly. In particular the "qedf->global_queues" have not been
allocated so calling qedf_free_global_queues() will lead to a NULL
dereference when we check if (!gl[i]) and "gl" is NULL.
Fixes: 09e062ce83cb ("qedf: Fix NULL dereference in error handling")
Signed-off-by: Jinhong Zhu <jinhongzhu@hust.edu.cn>
Reviewed-by: Dan Carpenter <error27@gmail.com>
---
drivers/scsi/qedf/qedf_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 35e16600fc63..f2c7dd4db9c6 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -3043,9 +3043,8 @@ static int qedf_alloc_global_queues(struct qedf_ctx *qedf)
* addresses of our queues
*/
if (!qedf->p_cpuq) {
- status = -EINVAL;
QEDF_ERR(&qedf->dbg_ctx, "p_cpuq is NULL.\n");
- goto mem_alloc_failure;
+ return -EINVAL;
}
qedf->global_queues = kzalloc((sizeof(struct global_queue *)
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] qedf: Fix NULL dereference in error handling
2023-04-17 13:55 [PATCH] qedf: Fix NULL dereference in error handling Jinhong Zhu
@ 2023-04-25 3:41 ` Martin K. Petersen
2023-04-25 12:58 ` Jinhong Zhu
2023-05-02 14:15 ` Jinhong Zhu
1 sibling, 1 reply; 5+ messages in thread
From: Martin K. Petersen @ 2023-04-25 3:41 UTC (permalink / raw)
To: Jinhong Zhu
Cc: Saurav Kashyap, Javed Hasan, GR-QLogic-Storage-Upstream,
James E.J. Bottomley, Martin K. Petersen, Dan Carpenter,
linux-scsi, linux-kernel
Jinhong,
> Fixes: 09e062ce83cb ("qedf: Fix NULL dereference in error handling")
This commit does not appear to exist in Linus' tree.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: [PATCH] qedf: Fix NULL dereference in error handling
2023-04-25 3:41 ` Martin K. Petersen
@ 2023-04-25 12:58 ` Jinhong Zhu
2023-05-02 12:52 ` Dan Carpenter
0 siblings, 1 reply; 5+ messages in thread
From: Jinhong Zhu @ 2023-04-25 12:58 UTC (permalink / raw)
To: martin.petersen
Cc: GR-QLogic-Storage-Upstream, error27, jejb, jhasan, jinhongzhu,
linux-kernel, linux-scsi, skashyap
>> Fixes: 09e062ce83cb ("qedf: Fix NULL dereference in error handling")
>This commit does not appear to exist in Linus' tree.
Sorry for the wrong fixes tag.
This is the correct one.
Fixes: 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.")
regards,
jinhong zhu
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: [PATCH] qedf: Fix NULL dereference in error handling
2023-04-25 12:58 ` Jinhong Zhu
@ 2023-05-02 12:52 ` Dan Carpenter
0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2023-05-02 12:52 UTC (permalink / raw)
To: Jinhong Zhu
Cc: martin.petersen, GR-QLogic-Storage-Upstream, error27, jejb,
jhasan, linux-kernel, linux-scsi, skashyap
On Tue, Apr 25, 2023 at 08:58:23PM +0800, Jinhong Zhu wrote:
> >> Fixes: 09e062ce83cb ("qedf: Fix NULL dereference in error handling")
>
> >This commit does not appear to exist in Linus' tree.
>
> Sorry for the wrong fixes tag.
>
> This is the correct one.
>
> Fixes: 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.")
You need to send a v2 patch. I have written a blog about this process.
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] qedf: Fix NULL dereference in error handling
2023-04-17 13:55 [PATCH] qedf: Fix NULL dereference in error handling Jinhong Zhu
2023-04-25 3:41 ` Martin K. Petersen
@ 2023-05-02 14:15 ` Jinhong Zhu
1 sibling, 0 replies; 5+ messages in thread
From: Jinhong Zhu @ 2023-05-02 14:15 UTC (permalink / raw)
To: jinhongzhu
Cc: GR-QLogic-Storage-Upstream, error27, jejb, jhasan, linux-kernel,
linux-scsi, martin.petersen, skashyap
Please do not apply this.
regards,
jinhong zhu
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-05-02 14:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-17 13:55 [PATCH] qedf: Fix NULL dereference in error handling Jinhong Zhu
2023-04-25 3:41 ` Martin K. Petersen
2023-04-25 12:58 ` Jinhong Zhu
2023-05-02 12:52 ` Dan Carpenter
2023-05-02 14:15 ` Jinhong Zhu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).