CC: kbuild-...@lists.01.org
CC: linux-ker...@vger.kernel.org
TO: "Christoph, Hellwig," <h...@lst.de>
CC: Jens Axboe <ax...@kernel.dk>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   3d77e6a8804abcc0504c904bd6e5cdf3a5cf8162
commit: 387048bf67eeff8bdf7c2a41b03b48230a88b3d3 block: merge 
partition-generic.c and check.c
date:   10 weeks ago
:::::: branch date: 15 hours ago
:::::: commit date: 10 weeks ago
config: mips-randconfig-m031-20200601 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <l...@intel.com>
Reported-by: Dan Carpenter <dan.carpen...@oracle.com>

smatch warnings:
block/partitions/core.c:173 check_partition() warn: passing zero to 'ERR_PTR'

# 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=387048bf67eeff8bdf7c2a41b03b48230a88b3d3
git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout 387048bf67eeff8bdf7c2a41b03b48230a88b3d3
vim +/ERR_PTR +173 block/partitions/core.c

387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  115  
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  116  
static struct parsed_partitions *check_partition(struct gendisk *hd,
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  117      
        struct block_device *bdev)
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  118  {
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  119      
struct parsed_partitions *state;
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  120      
int i, res, err;
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  121  
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  122      
state = allocate_partitions(hd);
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  123      
if (!state)
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  124      
        return NULL;
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  125      
state->pp_buf = (char *)__get_free_page(GFP_KERNEL);
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  126      
if (!state->pp_buf) {
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  127      
        free_partitions(state);
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  128      
        return NULL;
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  129      
}
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  130      
state->pp_buf[0] = '\0';
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  131  
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  132      
state->bdev = bdev;
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  133      
disk_name(hd, 0, state->name);
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  134      
snprintf(state->pp_buf, PAGE_SIZE, " %s:", state->name);
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  135      
if (isdigit(state->name[strlen(state->name)-1]))
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  136      
        sprintf(state->name, "p");
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  137  
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  138      
i = res = err = 0;
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  139      
while (!res && check_part[i]) {
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  140      
        memset(state->parts, 0, state->limit * sizeof(state->parts[0]));
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  141      
        res = check_part[i++](state);
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  142      
        if (res < 0) {
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  143      
                /*
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  144      
                 * We have hit an I/O error which we don't report now.
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  145      
                 * But record it, and let the others do their job.
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  146      
                 */
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  147      
                err = res;
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  148      
                res = 0;
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  149      
        }
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  150  
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  151      
}
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  152      
if (res > 0) {
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  153      
        printk(KERN_INFO "%s", state->pp_buf);
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  154  
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  155      
        free_page((unsigned long)state->pp_buf);
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  156      
        return state;
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  157      
}
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  158      
if (state->access_beyond_eod)
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  159      
        err = -ENOSPC;
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  160      
/*
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  161      
 * The partition is unrecognized. So report I/O errors if there were any
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  162      
 */
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  163      
if (err)
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  164      
        res = err;
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  165      
if (res) {
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  166      
        strlcat(state->pp_buf,
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  167      
                " unable to read partition table\n", PAGE_SIZE);
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  168      
        printk(KERN_INFO "%s", state->pp_buf);
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  169      
}
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  170  
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  171      
free_page((unsigned long)state->pp_buf);
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  172      
free_partitions(state);
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24 @173      
return ERR_PTR(res);
387048bf67eeff block/partitions/core.c   Christoph Hellwig 2020-03-24  174  }
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  175  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-le...@lists.01.org

Reply via email to