RE: [PATCH] staging:brcm80211:bug fix- rmmod hang problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the tips.
I did not pay attention to optimization. 
I will send the patch with the fix.

Thanks
Nohee

-----Original Message-----
From: Jiri Slaby [mailto:jirislaby@xxxxxxxxx] 
Sent: Wednesday, October 13, 2010 6:21 AM
To: Nohee Ko
Cc: greg@xxxxxxxxx; devel@xxxxxxxxxxxxxxxxxxxxxx; joe@xxxxxxxxxxx; Henry Ptasinski; Brett Rudley; Venkat Rao; grundler@xxxxxxxxxx; jason@xxxxxxxxxxxxxx
Subject: Re: [PATCH] staging:brcm80211:bug fix- rmmod hang problem

On 10/12/2010 10:33 PM, nohee ko wrote:
> --- a/drivers/staging/brcm80211/include/linuxver.h
> +++ b/drivers/staging/brcm80211/include/linuxver.h
> @@ -35,14 +35,11 @@
>  #undef IP_TOS
>  #include <asm/io.h>
>  
> -#define KILL_PROC(nr, sig) \
> +#define KILL_PROC(pid, sig) \
>  	do { \
>  		struct task_struct *tsk; \
> -		struct pid *pid;    \
> -		pid = find_get_pid((pid_t)nr);    \
> -		tsk = pid_task(pid, PIDTYPE_PID);    \
> -		if (tsk) \
> -			send_sig(sig, tsk, 1); \
> +		tsk = pid_task(find_vpid(pid), PIDTYPE_PID);    \
> +		if (tsk)	\
> +		send_sig(sig, tsk, 1); \

This is broken. You have to hold rcu_read_lock() here otherwise you are
unsafe and can blow up. Actually you don't need that crap at all. You
have already task_struct, so you can easily call send_sig directly.

And instead of these weird plays with signals and abuse of semaphores,
you can use completion, can't you?

regards,
-- 
js


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux