2022-04-29 14:49:19

by Shubhrajyoti Datta

[permalink] [raw]
Subject: [PATCH 2/7] tty: xilinx_uartps: Check the clk_enable return value

Check the clk_enable return value.

Addresses-Coverity: Event check_return.
Signed-off-by: Shubhrajyoti Datta <[email protected]>
---
drivers/tty/serial/xilinx_uartps.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index fa82f88844a1..8f15fe24a0eb 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1397,9 +1397,17 @@ static int __maybe_unused cdns_runtime_resume(struct device *dev)
{
struct uart_port *port = dev_get_drvdata(dev);
struct cdns_uart *cdns_uart = port->private_data;
+ int ret;
+
+ ret = clk_enable(cdns_uart->pclk);
+ if (ret)
+ return ret;

- clk_enable(cdns_uart->pclk);
- clk_enable(cdns_uart->uartclk);
+ ret = clk_enable(cdns_uart->uartclk);
+ if (ret) {
+ clk_disable(cdns_uart->pclk);
+ return ret;
+ }
return 0;
};

--
2.25.1


2022-05-09 06:00:23

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 2/7] tty: xilinx_uartps: Check the clk_enable return value

On Fri, Apr 29, 2022 at 01:44:17PM +0530, Shubhrajyoti Datta wrote:
> Check the clk_enable return value.

That says what, but not why.

>
> Addresses-Coverity: Event check_return.

Shouldn't this be a covertity id?

thanks,

greg k-h

2022-07-28 11:12:18

by Datta, Shubhrajyoti

[permalink] [raw]
Subject: RE: [PATCH 2/7] tty: xilinx_uartps: Check the clk_enable return value

[AMD Official Use Only - General]

Hi Greg,

> -----Original Message-----
> From: Greg KH <[email protected]>
> Sent: Friday, May 6, 2022 2:20 AM
> To: Shubhrajyoti Datta <[email protected]>
> Cc: [email protected]; [email protected];
> [email protected]; [email protected]; [email protected]
> Subject: Re: [PATCH 2/7] tty: xilinx_uartps: Check the clk_enable return value
>
> On Fri, Apr 29, 2022 at 01:44:17PM +0530, Shubhrajyoti Datta wrote:
> > Check the clk_enable return value.
>
> That says what, but not why.
>
Will fix v2.
> >
> > Addresses-Coverity: Event check_return.
>
> Shouldn't this be a covertity id?

I could not find the warning in the Coverity that is run on the linux kernel.
Somehow was seeing int when I was running locally.

>
> thanks,
>
> greg k-h

2022-07-28 11:59:22

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 2/7] tty: xilinx_uartps: Check the clk_enable return value

On Thu, Jul 28, 2022 at 11:09:10AM +0000, Datta, Shubhrajyoti wrote:
> [AMD Official Use Only - General]
>
> Hi Greg,
>
> > -----Original Message-----
> > From: Greg KH <[email protected]>
> > Sent: Friday, May 6, 2022 2:20 AM
> > To: Shubhrajyoti Datta <[email protected]>
> > Cc: [email protected]; [email protected];
> > [email protected]; [email protected]; [email protected]
> > Subject: Re: [PATCH 2/7] tty: xilinx_uartps: Check the clk_enable return value
> >
> > On Fri, Apr 29, 2022 at 01:44:17PM +0530, Shubhrajyoti Datta wrote:
> > > Check the clk_enable return value.
> >
> > That says what, but not why.
> >
> Will fix v2.
> > >
> > > Addresses-Coverity: Event check_return.
> >
> > Shouldn't this be a covertity id?
>
> I could not find the warning in the Coverity that is run on the linux kernel.
> Somehow was seeing int when I was running locally.

Ok, then there's no need to reference coverity at all then :)

thanks,

greg k-h