Linux-EROFS Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: chao@kernel.org (Chao Yu)
Subject: [PATCH] staging: erofs: fix error handling in __erofs_get_meta_page
Date: Mon, 20 Aug 2018 22:59:58 +0800	[thread overview]
Message-ID: <8316478d-940b-abbb-ca6d-bc4283d06a66@kernel.org> (raw)
In-Reply-To: <1534771743-129893-1-git-send-email-gaoxiang25@huawei.com>

On 2018/8/20 21:29, Gao Xiang wrote:
> As Dan reported in LKP's mailing list:
> 
> https://lists.01.org/pipermail/kbuild-all/2018-August/051419.html
> 
> New smatch warnings:
> drivers/staging/erofs/internal.h:446 erofs_grab_bio() warn: should 'blkaddr << (12 - 9)' be a 64 bit type?
> drivers/staging/erofs/data.c:78 __erofs_get_meta_page() error: 'bio' dereferencing possible ERR_PTR()
> drivers/staging/erofs/internal.h:446 erofs_grab_bio() warn: should 'blkaddr << (12 - 9)' be a 64 bit type?
> 
> Old smatch warnings:
> drivers/staging/erofs/unzip_vle.c:989 z_erofs_vle_unzip() error: double unlock 'mutex:&z_pagemap_global_lock'
> drivers/staging/erofs/unzip_vle.c:1318 z_erofs_vle_normalaccess_readpage() warn: should 'page->index << 12' be a 64 bit type?
> drivers/staging/erofs/unzip_vle.c:1351 __z_erofs_vle_normalaccess_readpages() warn: should '()->index << 12' be a 64 bit type?
> 
> Signed-off-by: Gao Xiang <gaoxiang25 at huawei.com>
> ---
> Hi Chao,
> 
> Could you please fold this patch in the previous patch if it is convenient?
> `staging: erofs: separate erofs_get_meta_page'
> 
> It seems v2 of these patches has not been sent out to the staging mailing list.
> LINK: https://lore.kernel.org/lkml/ffd2748a-273f-792b-d418-2fcf85c3d45f at huawei.com/

Hi Xiang,

Let me merge this into previous buggy one. :)

Thanks,

> 
> Thanks,
> Gao Xiang
> 
>  drivers/staging/erofs/data.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/erofs/data.c b/drivers/staging/erofs/data.c
> index 87a18a0..3c0d915 100644
> --- a/drivers/staging/erofs/data.c
> +++ b/drivers/staging/erofs/data.c
> @@ -63,9 +63,9 @@ struct page *__erofs_get_meta_page(struct super_block *sb,
>  		struct bio *bio;
>  
>  		bio = erofs_grab_bio(sb, blkaddr, 1, read_endio, nofail);
> -		if (unlikely(bio == NULL)) {
> +		if (IS_ERR(bio)) {
>  			DBG_BUGON(nofail);
> -			err = -ENOMEM;
> +			err = PTR_ERR(bio);
>  			goto err_out;
>  		}
>  
> 

  reply	other threads:[~2018-08-20 14:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-20 13:29 [PATCH] staging: erofs: fix error handling in __erofs_get_meta_page Gao Xiang
2018-08-20 14:59 ` Chao Yu [this message]
2018-08-20 15:36   ` Gao Xiang
2018-08-20 15:45     ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8316478d-940b-abbb-ca6d-bc4283d06a66@kernel.org \
    --to=chao@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox