lkml.org 
[lkml]   [2022]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net: ax88179: add proper error handling of usb read errors
From


On 13.04.22 17:32, Dan Carpenter wrote:
>
> Bug: buffer partially filled. Information leak.
>
> If you return the bytes then the only correct way to write error
> handling is:
>
> if (ret < 0)
> return ret;
> if (ret != size)
> return -EIO;
>
You have to make up your mind on whether you ever need to read
answer of a length not known before you try it. The alternative of
passing a pointer to an integer for length is worse.

    Regards
        Oliver

\
 
 \ /
  Last update: 2022-04-14 09:33    [W:0.116 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site