Skip to contentSkip to conversation

media: v4l: async: Don't set notifier's V4L2 device if registering fails

git:media_stage/master Hans Verkuil 1 participant 1 message Apr 10, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

This is an automatic generated email to let you know that the following patch were queued:

Subject: media: v4l: async: Don't set notifier's V4L2 device if registering fails
Author:  Sakari Ailus <[email protected]>
Date:    Fri Mar 8 15:07:45 2024 +0200

The V4L2 device used to be set when the notifier was registered but this has been moved to the notifier initialisation. Don't touch the V4L2 device if registration fails.

Fixes b8ec754ae4c5 ("media: v4l: async: Set v4l2_device and subdev in async notifier init")
Cc <[email protected]> # for 6.6 and later
 drivers/media/v4l2-core/v4l2-async.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

---

drivers/media/v4l2-core/v4l2-async.c +1 -7
index 6a7dcf43d712..2ff35d5d60f2 100644
@@ -620,16 +620,10 @@ err_unlock:
 
 int v4l2_async_nf_register(struct v4l2_async_notifier *notifier)
 {
-	int ret;
-
 	if (WARN_ON(!notifier->v4l2_dev == !notifier->sd))
 		return -EINVAL;
 
-	ret = __v4l2_async_nf_register(notifier);
-	if (ret)
-		notifier->v4l2_dev = NULL;
-
-	return ret;
+	return __v4l2_async_nf_register(notifier);
 }
 EXPORT_SYMBOL(v4l2_async_nf_register);