linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: "skhan@linuxfoundation.org" <skhan@linuxfoundation.org>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 04/20] media: uvc: uvc_v4l2.c: add temp variable for list iteration
Date: Mon, 10 Aug 2020 10:10:45 -0300	[thread overview]
Message-ID: <6FF983D6-F754-42CB-8745-EF1DFA76B12F@getmailspring.com> (raw)
In-Reply-To: <20200808204517.GJ6186@pendragon.ideasonboard.com>

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

      reply	other threads:[~2020-08-10 13:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07  8:35 [PATCH 04/20] media: uvc: uvc_v4l2.c: add temp variable for list iteration Daniel W. S. Almeida
2020-08-08 20:45 ` Laurent Pinchart
2020-08-10 13:10   ` Daniel W. S. Almeida [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6FF983D6-F754-42CB-8745-EF1DFA76B12F@getmailspring.com \
    --to=dwlsalmeida@gmail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).