From 317efce991620adc589b3005b9baed433dcb2a56 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 24 Nov 2012 21:35:48 -0300 Subject: [PATCH] [media] v4l: Reset subdev v4l2_dev field to NULL if registration fails When subdev registration fails the subdev v4l2_dev field is left to a non-NULL value. Later calls to v4l2_device_unregister_subdev() will consider the subdev as registered and will module_put() the subdev module without any matching module_get(). Fix this by setting the subdev v4l2_dev field to NULL in v4l2_device_register_subdev() when the function fails. Signed-off-by: Laurent Pinchart Cc: stable@vger.kernel.org Acked-by: Sylwester Nawrocki Signed-off-by: Mauro Carvalho Chehab --- Reading git-format-patch failed