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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>

commit 46bc0234ad38063ce550ecf135c1a52458f0a804 upstream.

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: <stable@xxxxxxxxxxxxxxx> # for 6.6 and later
Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/media/v4l2-core/v4l2-async.c |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -618,16 +618,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);
 


Patches currently in stable-queue which might be from sakari.ailus@xxxxxxxxxxxxxxx are

queue-6.9/media-mc-fix-graph-walk-in-media_pipeline_start.patch
queue-6.9/media-ov2740-fix-link_freq-and-pixel_rate-control-value-reporting.patch
queue-6.9/media-v4l-async-fix-notifier-list-entry-init.patch
queue-6.9/media-v4l-async-don-t-set-notifier-s-v4l2-device-if-registering-fails.patch
queue-6.9/media-mc-mark-the-media-devnode-as-registered-from-the-start.patch
queue-6.9/media-v4l-async-properly-re-initialise-notifier-entry-in-unregister.patch
queue-6.9/media-v4l2-core-hold-videodev_lock-until-dev-reg-finishes.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux