lkml.org 
[lkml]   [2020]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/20] media: uvc: uvc_v4l2.c: add temp variable for list iteration
Hi Laurent, thanks for reviewing!

> If no entity is found by this loop the next line will dereference a NULL
> pointer. There's a similar issue below.

You mean this line, right?
> pin = iterm->id;

In which case, yes I missed it!

> I think the issues reported by coccinelle are false positives, as every
> chain is guaranteed to have the proper input terminals (ITERM). This is
> verified when constructing the chain at probe time.

I thought so too, but I thought it would be nice to get rid of the
warning anyways. Probably other people will send patches for this same
issue in the future too, i.e. until this warning is not there anymore.

Do you have any suggestions or should we just leave this alone? :)

Maybe:

if (iterm)
pin = iterm->id


This line will return an error if the iterm is not found anyway:

if (iterm == NULL || iterm->id != pin)
return -EINVAL


Let me know what you think

- Daniel

\
 
 \ /
  Last update: 2020-08-10 15:11    [W:0.038 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site