Linux Media Controller development
 help / color / mirror / Atom feed
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>,
	linux-media@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	NXP Linux Team <linux-imx@nxp.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Shawn Guo <shawnguo@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] media: nxp: isi: Check whether pad is non-NULL before access
Date: Thu, 11 Jan 2024 17:52:55 +0000	[thread overview]
Message-ID: <170499557567.3227220.6762054427400627231@ping.linuxembedded.co.uk> (raw)
In-Reply-To: <20231203170057.GB22111@pendragon.ideasonboard.com>

Quoting Laurent Pinchart (2023-12-03 17:00:57)
> On Sat, Dec 02, 2023 at 07:44:47AM +0100, Marek Vasut wrote:
> > On 12/2/23 03:27, Fabio Estevam wrote:
> > > On Fri, Dec 1, 2023 at 12:06 PM Marek Vasut <marex@denx.de> wrote:
> > > 
> > >>          pad = media_pad_remote_pad_first(&xbar->pads[sink_pad]);
> > >> -       sd = media_entity_to_v4l2_subdev(pad->entity);
> > >> +       if (!pad) {
> > >> +               dev_dbg(xbar->isi->dev,
> > > 
> > > Maybe dev_err() here instead?
> > 
> > That dev_dbg() is aligned with the prints in the rest of the function 
> > and it's not like kernel should do dev_err() into kernel log every time 
> > userspace does something wrong.
> 
> We usually use dev_dbg() for errors that can be easily triggered from
> userspace, to avoid giving unpriviledged processes an easy way to flood
> the kernel log.

When this call returns it will also report a dev_err "Failed to enable
pipe":

[   56.806321] mxc-isi 32e00000.isi: no pad connecxted to crossbar input 0
[   56.813655] mxc-isi 32e00000.isi: Failed to enable pipe 0

Personally - I'd make this print dev_err so the /reason/ we failed to
enable the pipe is also stated.

But I can confirm this is a bug and fairly easily trigged by attempting
to capture from the ISI through the libcamera simple pipeline handler,
which (I believe) does not do any route handling at present.

Which ever log level:

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>


And this needs to go to stable, as this caused a null-pointer-deref for
me on a v6.6 tree.

--
Kieran


> 
> > > Anyway:
> > > 
> > > Reviewed-by: Fabio Estevam <festevam@gmail.com>
> > 
> > Thanks !
> 
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-01-11 17:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01 15:06 [PATCH] media: nxp: isi: Check whether pad is non-NULL before access Marek Vasut
2023-12-02  2:27 ` Fabio Estevam
2023-12-02  6:44   ` Marek Vasut
2023-12-03 17:00     ` Laurent Pinchart
2024-01-11 17:52       ` Kieran Bingham [this message]
2023-12-03 16:59 ` Laurent Pinchart
2024-01-11 17:49   ` Kieran Bingham
2024-01-11 17:52     ` Laurent Pinchart
2024-01-13  0:03       ` Laurent Pinchart
2024-01-13  0:21         ` Laurent Pinchart
2024-01-13  3:05         ` Marek Vasut

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=170499557567.3227220.6762054427400627231@ping.linuxembedded.co.uk \
    --to=kieran.bingham@ideasonboard.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-media@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=mchehab@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.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