nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Vishal Verma <vishal.l.verma@intel.com>
To: linux-nvdimm@lists.01.org
Subject: [ndctl PATCH v2 3/5] util/json: fix an error check for region resource
Date: Wed,  3 Oct 2018 12:15:04 -0600	[thread overview]
Message-ID: <20181003181506.17682-3-vishal.l.verma@intel.com> (raw)
In-Reply-To: <20181003181506.17682-1-vishal.l.verma@intel.com>

The return type of ndctl_region_get_resource() is 'unsigned long long',
and therefore the error checking for it should be done against
ULLONG_MAX. Fix an instance where we were checking against ULONG_MAX.

Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 util/json.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/json.c b/util/json.c
index 2d15859..30b56c3 100644
--- a/util/json.c
+++ b/util/json.c
@@ -470,7 +470,7 @@ struct json_object *util_region_badblocks_to_json(struct ndctl_region *region,
 
 		/* get start address of region */
 		addr = ndctl_region_get_resource(region);
-		if (addr == ULONG_MAX)
+		if (addr == ULLONG_MAX)
 			goto err_array;
 
 		/* get address of bad block */
-- 
2.17.1

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  parent reply	other threads:[~2018-10-03 18:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 18:15 [ndctl PATCH v2 1/5] ndctl, lib: refactor badblocks retrieval routines Vishal Verma
2018-10-03 18:15 ` [ndctl PATCH v2 2/5] ndctl, lib: add APIs for retrieving namespace badblocks Vishal Verma
2018-10-03 18:15 ` Vishal Verma [this message]
2018-10-03 18:15 ` [ndctl PATCH v2 4/5] util/json: Add comments around re-checking the UTIL_JSON_MEDIA_ERRORS flag Vishal Verma
2018-10-03 21:31   ` Williams, Dan J
2018-10-03 18:15 ` [ndctl PATCH v2 5/5] util/json: add a util_namespace_badblocks_to_json() helper Vishal Verma

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=20181003181506.17682-3-vishal.l.verma@intel.com \
    --to=vishal.l.verma@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;
as well as URLs for NNTP newsgroup(s).