[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210111133521.GB34341@kozik-lap>
Date: Mon, 11 Jan 2021 14:35:21 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
linux-kernel@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
linux-rtc@...r.kernel.org,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: Re: [PATCH v4 2/3] rtc: s5m: check the return value of
s5m8767_rtc_init_reg()
On Mon, Jan 11, 2021 at 01:40:26PM +0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@...libre.com>
>
> This function can fail if regmap operations fail so check its return
> value in probe().
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
> ---
> drivers/rtc/rtc-s5m.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
> index eb9dde4095a9..e0011d3cf61b 100644
> --- a/drivers/rtc/rtc-s5m.c
> +++ b/drivers/rtc/rtc-s5m.c
> @@ -791,6 +791,8 @@ static int s5m_rtc_probe(struct platform_device *pdev)
> platform_set_drvdata(pdev, info);
>
> ret = s5m8767_rtc_init_reg(info);
> + if (ret)
> + return ret;
You leak I2C device.
Best regards,
Krzysztof
Powered by blists - more mailing lists