FreeBSD Bugzilla – Attachment 233305 Details for
Bug 263396
Fix a possible NULL pointer dereference bug in ocs_hw_setup()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
A possible fix for this bug
0001-Fix-a-possible-NULL-pointer-dereference-bug-caused-b.patch (text/plain), 1.19 KB, created by
Zhou Qingyang
on 2022-04-18 16:20:36 UTC
(
hide
)
Description:
A possible fix for this bug
Filename:
MIME Type:
Creator:
Zhou Qingyang
Created:
2022-04-18 16:20:36 UTC
Size:
1.19 KB
patch
obsolete
>From 8c35b8df0399fe9b750b8ce24156237d930c1eac Mon Sep 17 00:00:00 2001 >From: Zhou Qingyang <zhou1615@umn.edu> >Date: Mon, 18 Apr 2022 23:39:14 +0800 >Subject: [PATCH] Fix a possible NULL pointer dereference bug caused by > ocs_hw_qtop_parse() > >The function ocs_hw_qtop_parse() could return NULL on malloc failure. >However the caller function ocs_hw_setup() of ocs_hw_qtop_parse() >uses the return value without check, which could lead to NULL pointer >dereference. > >Fix this by adding a NULL check. > >this patch is a possible fix. >--- > sys/dev/ocs_fc/ocs_hw.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/sys/dev/ocs_fc/ocs_hw.c b/sys/dev/ocs_fc/ocs_hw.c >index 65fc01f62846..fa375179c56f 100644 >--- a/sys/dev/ocs_fc/ocs_hw.c >+++ b/sys/dev/ocs_fc/ocs_hw.c >@@ -464,7 +464,8 @@ ocs_hw_setup(ocs_hw_t *hw, ocs_os_handle_t os, sli4_port_type_e port_type) > hw->config.queue_topology = hw_global.queue_topology_string; > > hw->qtop = ocs_hw_qtop_parse(hw, hw->config.queue_topology); >- >+ if (hw->qtop == NULL) >+ return OCS_HW_RTN_ERROR; > hw->config.n_eq = hw->qtop->entry_counts[QTOP_EQ]; > hw->config.n_cq = hw->qtop->entry_counts[QTOP_CQ]; > hw->config.n_rq = hw->qtop->entry_counts[QTOP_RQ]; >-- >2.25.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 263396
: 233305