From: Dan Carpenter <dan.carpenter@oracle.com>
To: dan.j.williams@intel.com
Cc: linux-nvdimm@lists.01.org
Subject: [bug report] device-dax: add dis-contiguous resource support
Date: Mon, 31 Aug 2020 14:32:35 +0300 [thread overview]
Message-ID: <20200831113235.GA512956@mwanda> (raw)
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 },
regards,
dan carpenter
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
next reply other threads:[~2020-08-31 11:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-31 11:32 Dan Carpenter [this message]
2020-08-31 19:03 ` [bug report] device-dax: add dis-contiguous resource support Joao Martins
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=20200831113235.GA512956@mwanda \
--to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.