[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200623195407.843697778@linuxfoundation.org>
Date: Tue, 23 Jun 2020 21:50:02 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Dan Carpenter <dan.carpenter@...cle.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.7 005/477] rtc: rc5t619: Fix an ERR_PTR vs NULL check
From: Dan Carpenter <dan.carpenter@...cle.com>
[ Upstream commit 11ddbdfb68e4f9791e4bd4f8d7c87d3f19670967 ]
The devm_kzalloc() function returns NULL on error, it doesn't return
error pointers so this check doesn't work.
Fixes: 540d1e15393d ("rtc: rc5t619: Add Ricoh RC5T619 RTC driver")
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
Link: https://lore.kernel.org/r/20200407092852.GI68494@mwanda
Signed-off-by: Alexandre Belloni <alexandre.belloni@...tlin.com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/rtc/rtc-rc5t619.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-rc5t619.c b/drivers/rtc/rtc-rc5t619.c
index 24e386ecbc7ed..dd1a20977478e 100644
--- a/drivers/rtc/rtc-rc5t619.c
+++ b/drivers/rtc/rtc-rc5t619.c
@@ -356,10 +356,8 @@ static int rc5t619_rtc_probe(struct platform_device *pdev)
int err;
rtc = devm_kzalloc(dev, sizeof(*rtc), GFP_KERNEL);
- if (IS_ERR(rtc)) {
- err = PTR_ERR(rtc);
+ if (!rtc)
return -ENOMEM;
- }
rtc->rn5t618 = rn5t618;
--
2.25.1
Powered by blists - more mailing lists