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]
Message-ID: <8327ab0b-a6f4-7580-fb79-b079500c26fe@redhat.com>
Date:   Wed, 22 Sep 2021 13:24:37 +0200
From:   David Hildenbrand <david@...hat.com>
To:     Xu Wang <vulab@...as.ac.cn>, akpm@...ux-foundation.org
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/swapfile: Remove needless request_queue NULL pointer
 check

On 17.09.21 10:21, Xu Wang wrote:
> The request_queue pointer returned from bdev_get_queue() shall
> never be NULL, so the null check is unnecessary, just remove it.
> 
> Signed-off-by: Xu Wang <vulab@...as.ac.cn>
> ---
>   mm/swapfile.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index 22d10f713848..42027d213fd2 100644
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
> @@ -3118,7 +3118,7 @@ static bool swap_discardable(struct swap_info_struct *si)
>   {
>   	struct request_queue *q = bdev_get_queue(si->bdev);
>   
> -	if (!q || !blk_queue_discard(q))
> +	if (!blk_queue_discard(q))
>   		return false;
>   
>   	return true;
> 

Right, there is even a comment in bdev_get_queue "this is never NULL".

Acked-by: David Hildenbrand <david@...hat.com>

-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ