linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xidong Wang <wangxidong_97@163.com>
To: Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Xidong Wang <wangxidong_97@163.com>,
	linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] rtc: rv3028: check return value
Date: Wed, 29 May 2019 15:22:20 +0800	[thread overview]
Message-ID: <1559114540-30878-1-git-send-email-wangxidong_97@163.com> (raw)

In rv3028_probe(), the return value of devm_regmap_init_i2c() should
be checked before it is used.

Signed-off-by: Xidong Wang <wangxidong_97@163.com>
---
 drivers/rtc/rtc-rv3028.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/rtc/rtc-rv3028.c b/drivers/rtc/rtc-rv3028.c
index 06884eb..29a8c4e 100644
--- a/drivers/rtc/rtc-rv3028.c
+++ b/drivers/rtc/rtc-rv3028.c
@@ -626,6 +626,10 @@ static int rv3028_probe(struct i2c_client *client)
 
 	rv3028->regmap = devm_regmap_init_i2c(client, &regmap_config);
 
+	if (IS_ERR(rv3028->regmap)) {
+		return PTR_ERR(rv3028->regmap);
+	}
+
 	i2c_set_clientdata(client, rv3028);
 
 	ret = regmap_read(rv3028->regmap, RV3028_STATUS, &status);
-- 
2.7.4


             reply	other threads:[~2019-05-29  7:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29  7:22 Xidong Wang [this message]
2019-06-01 21:03 ` [PATCH 1/1] rtc: rv3028: check return value Alexandre Belloni

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=1559114540-30878-1-git-send-email-wangxidong_97@163.com \
    --to=wangxidong_97@163.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@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).