Thread (2 messages) flat view 2 messages, 2 authors, 2007-07-16

Re: [PATCH] [2.6.22] Fix a potential NULL pointer dereference in free_shared_mem() in drivers/net/s2io.c

From: Jeff Garzik <hidden>
Date: 2007-07-16 21:56:44
Also in: lkml

Micah Gruber wrote:
quoted hunk ↗ jump to hunk
This patch fixes a potential null dereference bug where we dereference
nic before a null check. This patch simply moves the dereferencing
after the null check.

Signed-off-by: Micah Gruber < micah.gruber@gmail.com>
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -789,12 +789,14 @@
       struct mac_info *mac_control;
       struct config_param *config;
       int lst_size, lst_per_page;
-       struct net_device *dev = nic->dev;
+       struct net_device *dev;
       int page_num = 0;

       if (!nic)
               return;

+       dev = nic->dev;
+
applied manually -- all of your patch attempts produced corrupted patches :/

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help