From: Ding Xiang <dingxiang@cmss.chinamobile.com>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] loop: fix passing zero to 'PTR_ERR' warning
Date: Wed, 24 Jun 2020 16:48:42 +0800 [thread overview]
Message-ID: <1592988522-4350-1-git-send-email-dingxiang@cmss.chinamobile.com> (raw)
Fix a static code checker warning:
drivers/block/loop.c:798 loop_attr_backing_file_show()
warn: passing zero to 'PTR_ERR'
Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
---
drivers/block/loop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 475e1a7..bcada87 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -795,7 +795,7 @@ static ssize_t loop_attr_backing_file_show(struct loop_device *lo, char *buf)
spin_unlock_irq(&lo->lo_lock);
if (IS_ERR_OR_NULL(p))
- ret = PTR_ERR(p);
+ ret = PTR_ERR_OR_ZERO(p);
else {
ret = strlen(p);
memmove(buf, p, ret);
--
2.7.4
next reply other threads:[~2020-06-24 8:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-24 8:48 Ding Xiang [this message]
2020-06-29 20:54 ` [PATCH] loop: fix passing zero to 'PTR_ERR' warning Al Viro
2020-11-12 14:52 [PATCH] loop: Fix " YueHaibing
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=1592988522-4350-1-git-send-email-dingxiang@cmss.chinamobile.com \
--to=dingxiang@cmss.chinamobile.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).