lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 21 Oct 2021 10:48:32 +0200
From:   Lars-Peter Clausen <lars@...afoo.de>
To:     Cai Huoqing <caihuoqing@...du.com>
Cc:     Jonathan Cameron <jic23@...nel.org>, linux-iio@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: adc: ina2xx: Make use of the helper macro
 kthread_run()

On 10/21/21 10:39 AM, Cai Huoqing wrote:
> Repalce kthread_create/wake_up_process() with kthread_run()
> to simplify the code.
>
> Signed-off-by: Cai Huoqing <caihuoqing@...du.com>

Hi,

Thanks for the patch, this looks good!

Reviewed-by: Lars-Peter Clausen <lars@...afoo.de>

> ---
> [...]
>   	if (IS_ERR(task))
>   		return PTR_ERR(task);
>   
>   	get_task_struct(task);

This is unrelated to this patch. But I wonder do we really need the 
get_task_struct()? The driver calls put_task_struct() right after 
kthread_stop().

kthread_create()/kthread_run() and kthread_stop() already do reference 
counting of the task, so we are essentially just double reference 
counting. Maybe you can send another patch to cleanup the 
get_task_struct()/put_task_struct() in this driver.

> -	wake_up_process(task);
>   	chip->task = task;
>   
>   	return 0;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ