lkml.org 
[lkml]   [2022]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] drivers/tty/serial: check the return value of uart_port_check()
On Fri, Aug 26, 2022 at 9:01 AM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Fri, Aug 26, 2022 at 11:38 AM Li Zhong <floridsleeves@gmail.com> wrote:
> >
> > uart_port_check() will return NULL pointer when state->uart_port is
> > NULL. Check the return value before dereference it to avoid
> > null-pointer-dereference error.
>
> Have you taken the locking into consideration?
> If no, please do, if yes, expand your commit message to explain why
> the current locking scheme doesn't prevent an error from happening.
>

The locking is taken into consideration but these three checks do not need to
unlock in error-handling because unlock() will be called in the callers. Will
add the comment in v2 patch.

> --
> With Best Regards,
> Andy Shevchenko

\
 
 \ /
  Last update: 2022-08-28 21:58    [W:0.068 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site