lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aWacHjLKiG0fsymG@kekkonen.localdomain>
Date: Tue, 13 Jan 2026 21:25:18 +0200
From: Sakari Ailus <sakari.ailus@...ux.intel.com>
To: Jacopo Mondi <jacopo.mondi@...asonboard.com>
Cc: "jempty.liang" <imntjempty@....com>,
	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	dan.scally@...asonboard.com, mchehab@...nel.org,
	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: mali-c55: Fix NULL dev stream alert for tpg
 sub-device

Hi Jacopo,

On Tue, Jan 13, 2026 at 01:43:12PM +0100, Jacopo Mondi wrote:
> Hi Sakari
> 
> On Tue, Jan 13, 2026 at 12:40:25PM +0200, Sakari Ailus wrote:
> > Hi Jacopo,
> >
> > On Tue, Jan 13, 2026 at 09:55:10AM +0100, Jacopo Mondi wrote:
> > > I wonder if v4l2_device_register_subdev() shouldn't WARN or if return
> > > an error if sd->dev is not initialized. Laurent, Sakari: opinions ?
> >
> > I might even return an error but I wonder what would break. Perhaps indeed
> > could start with a warning?
> 
> I would start with:
> 
> --- a/drivers/media/v4l2-core/v4l2-device.c
> +++ b/drivers/media/v4l2-core/v4l2-device.c
> @@ -117,6 +117,13 @@ int __v4l2_device_register_subdev(struct v4l2_device *v4l2_dev,
>         if (!v4l2_dev || !sd || sd->v4l2_dev || !sd->name[0])
>                 return -EINVAL;
> 
> +       /*
> +        * Initializing sd->dev is mandatory. Warn for now to give faulty
> +        * drivers a bit of time to update before actually returning an error.
> +        */
> +       WARN_ON(!sd->dev);
> +
>         /*
>          * The reason to acquire the module here is to avoid unloading
>          * a module of sub-device which is registered to a media
> 
> Would you like a patch ?

Please. :-)

-- 
Kind regards,

Sakari Ailus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ