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] [thread-next>] [day] [month] [year] [list]
Message-ID: <aWY8__K4nVs0bEWT@zed>
Date: Tue, 13 Jan 2026 13:43:12 +0100
From: Jacopo Mondi <jacopo.mondi@...asonboard.com>
To: Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc: Jacopo Mondi <jacopo.mondi@...asonboard.com>, 
	"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 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 ?

>
> --
> Sakari Ailus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ