* [PATCH] media: tuners: fix a missing check for regmap_write_bits
@ 2019-03-24 23:21 Kangjie Lu
2019-03-27 15:12 ` Mukesh Ojha
2019-04-04 20:09 ` Sean Young
0 siblings, 2 replies; 3+ messages in thread
From: Kangjie Lu @ 2019-03-24 23:21 UTC (permalink / raw)
To: kjlu
Cc: pakki001, Olli Salonen, Mauro Carvalho Chehab, linux-media, linux-kernel
regmap_write_bits could fail and thus deserves a check.
The fix returns its error code upstream in case it fails.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
drivers/media/tuners/tda18250.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/tuners/tda18250.c b/drivers/media/tuners/tda18250.c
index 20d10ef45ab6..36ede1b02d23 100644
--- a/drivers/media/tuners/tda18250.c
+++ b/drivers/media/tuners/tda18250.c
@@ -703,6 +703,8 @@ static int tda18250_set_params(struct dvb_frontend *fe)
/* charge pump */
ret = regmap_write_bits(dev->regmap, R46_CPUMP, 0x07, buf[2]);
+ if (ret)
+ goto err;
return 0;
err:
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] media: tuners: fix a missing check for regmap_write_bits
2019-03-24 23:21 [PATCH] media: tuners: fix a missing check for regmap_write_bits Kangjie Lu
@ 2019-03-27 15:12 ` Mukesh Ojha
2019-04-04 20:09 ` Sean Young
1 sibling, 0 replies; 3+ messages in thread
From: Mukesh Ojha @ 2019-03-27 15:12 UTC (permalink / raw)
To: Kangjie Lu
Cc: pakki001, Olli Salonen, Mauro Carvalho Chehab, linux-media, linux-kernel
On 3/25/2019 4:51 AM, Kangjie Lu wrote:
> regmap_write_bits could fail and thus deserves a check.
>
> The fix returns its error code upstream in case it fails.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
-Mukesh
> ---
> drivers/media/tuners/tda18250.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/media/tuners/tda18250.c b/drivers/media/tuners/tda18250.c
> index 20d10ef45ab6..36ede1b02d23 100644
> --- a/drivers/media/tuners/tda18250.c
> +++ b/drivers/media/tuners/tda18250.c
> @@ -703,6 +703,8 @@ static int tda18250_set_params(struct dvb_frontend *fe)
>
> /* charge pump */
> ret = regmap_write_bits(dev->regmap, R46_CPUMP, 0x07, buf[2]);
> + if (ret)
> + goto err;
>
> return 0;
> err:
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] media: tuners: fix a missing check for regmap_write_bits
2019-03-24 23:21 [PATCH] media: tuners: fix a missing check for regmap_write_bits Kangjie Lu
2019-03-27 15:12 ` Mukesh Ojha
@ 2019-04-04 20:09 ` Sean Young
1 sibling, 0 replies; 3+ messages in thread
From: Sean Young @ 2019-04-04 20:09 UTC (permalink / raw)
To: Kangjie Lu
Cc: pakki001, Olli Salonen, Mauro Carvalho Chehab, linux-media, linux-kernel
On Sun, Mar 24, 2019 at 06:21:10PM -0500, Kangjie Lu wrote:
> regmap_write_bits could fail and thus deserves a check.
>
> The fix returns its error code upstream in case it fails.
Has this been tested on real hardware?
Sean
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
> drivers/media/tuners/tda18250.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/media/tuners/tda18250.c b/drivers/media/tuners/tda18250.c
> index 20d10ef45ab6..36ede1b02d23 100644
> --- a/drivers/media/tuners/tda18250.c
> +++ b/drivers/media/tuners/tda18250.c
> @@ -703,6 +703,8 @@ static int tda18250_set_params(struct dvb_frontend *fe)
>
> /* charge pump */
> ret = regmap_write_bits(dev->regmap, R46_CPUMP, 0x07, buf[2]);
> + if (ret)
> + goto err;
>
> return 0;
> err:
> --
> 2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-04-04 20:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-24 23:21 [PATCH] media: tuners: fix a missing check for regmap_write_bits Kangjie Lu
2019-03-27 15:12 ` Mukesh Ojha
2019-04-04 20:09 ` Sean Young
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).