From: Joao Martins <joao.m.martins@oracle.com>
To: Dan Carpenter <dan.carpenter@oracle.com>, dan.j.williams@intel.com
Cc: linux-nvdimm@lists.01.org
Subject: Re: [bug report] device-dax: add dis-contiguous resource support
Date: Mon, 31 Aug 2020 20:03:07 +0100 [thread overview]
Message-ID: <e529f97e-29e0-33e1-5f46-bce76320ba4e@oracle.com> (raw)
In-Reply-To: <20200831113235.GA512956@mwanda>
On 8/31/20 12:32 PM, Dan Carpenter wrote:
> Hello Dan Williams,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch 454c727769f5: "device-dax: add dis-contiguous resource
> support" from Aug 26, 2020, leads to the following Smatch complaint:
>
> drivers/dax/bus.c:788 alloc_dev_dax_range()
> error: we previously assumed 'alloc' could be null (see line 772)
>
> drivers/dax/bus.c
> 771 alloc = __request_region(res, start, size, dev_name(dev), 0);
> 772 if (!alloc && !dev_dax->nr_range) {
> ^^
> This should probably be a ||?
>
> 773 /*
> 774 * If we adjusted an existing @ranges leave it alone,
> 775 * but if this was an empty set of ranges nothing else
> 776 * will release @ranges, so do it now.
> 777 */
> 778 kfree(ranges);
> 779 return -ENOMEM;
> 780 }
> 781
> 782 for (i = 0; i < dev_dax->nr_range; i++)
> 783 pgoff += PHYS_PFN(range_len(&ranges[i].range));
> 784 dev_dax->ranges = ranges;
> 785 ranges[dev_dax->nr_range++] = (struct dev_dax_range) {
> 786 .pgoff = pgoff,
> 787 .range = {
> 788 .start = alloc->start,
> ^^^^^^^^^^^^
> Dereferences.
>
> 789 .end = alloc->end,
> 790 },
>
This is already fixed in mmots:
https://www.ozlabs.org/~akpm/mmots/broken-out/device-dax-add-dis-contiguous-resource-support-fix.patch
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
prev parent reply other threads:[~2020-08-31 19:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-31 11:32 [bug report] device-dax: add dis-contiguous resource support Dan Carpenter
2020-08-31 19:03 ` Joao Martins [this message]
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=e529f97e-29e0-33e1-5f46-bce76320ba4e@oracle.com \
--to=joao.m.martins@oracle.com \
--cc=dan.carpenter@oracle.com \
--cc=dan.j.williams@intel.com \
--cc=linux-nvdimm@lists.01.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