Thread (11 messages) flat view 11 messages, 4 authors, 2017-03-21

Re: [PATCH 1/1] r8152: fix NULL pointer dereference in r8152_poll

From: Petr Vorel <hidden>
Date: 2017-03-13 15:37:49

Hi Eric,
quoted
The proper work around is to enclose the napi_schedule() in a
local_bh_enable()/local_bh_disable()  pair.
quoted hunk ↗ jump to hunk
Something like :
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -3703,8 +3703,10 @@ static int rtl8152_resume(struct usb_interface *intf)
 			napi_enable(&tp->napi);
 			clear_bit(SELECTIVE_SUSPEND, &tp->flags);
 			smp_mb__after_atomic();
+			local_bh_disable();
 			if (!list_empty(&tp->rx_done))
 				napi_schedule(&tp->napi);
+			local_bh_enable();
Unfortunately this doesn't work. Code in r8152.c doesn't use local_bh_enable()/local_bh_disable(). I tried to lock it with spin_lock_bh()/spin_unlock_bh() and with mutex_lock()/mutex_unlock() but neither work.


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