[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210826112745.5e1421ed@gmail.com>
Date: Thu, 26 Aug 2021 11:27:45 +0300
From: Pavel Skripkin <paskripkin@...il.com>
To: David Laight <David.Laight@...LAB.COM>
Cc: "Larry.Finger@...inger.net" <Larry.Finger@...inger.net>,
"phil@...lpotter.co.uk" <phil@...lpotter.co.uk>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"straube.linux@...il.com" <straube.linux@...il.com>,
"fmdefrancesco@...il.com" <fmdefrancesco@...il.com>,
"linux-staging@...ts.linux.dev" <linux-staging@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 3/6] staging: r8188eu: add error handling of
rtw_read8
On Thu, 26 Aug 2021 08:21:34 +0000
David Laight <David.Laight@...LAB.COM> wrote:
> From: Pavel Skripkin
> > Sent: 24 August 2021 08:27
> >
> > _rtw_read8 function can fail in case of usb transfer failure. But
> > previous function prototype wasn't designed to return an error to
> > caller. It can cause a lot uninit value bugs all across the driver
> > code, since rtw_read8() returns local stack variable to caller.
> >
> > Fix it by changing the prototype of this function. Now it returns an
> > int: 0 on success, negative error value on failure and callers
> > should pass the pointer to storage location for register value.
>
> ...
> > + len += snprintf(page + len, count - len,
> > "rtw_read8(0x%x)=0x%x\n",
> > + proc_get_read_addr, (u8) tmp);
>
> That is broken.
>
Don't get it, sorry. Previous code did exactly the same thing, but
didn't check if read() was successful.
With regards,
Pavel Skripkin
Powered by blists - more mailing lists