From: Laurent Pinchart Date: Sun, 25 Nov 2012 00:35:48 +0000 (-0300) Subject: v4l: Reset subdev v4l2_dev field to NULL if registration fails X-Git-Tag: v3.2.40~148 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=754aed1b98d1c1ed2a8eaae2fc933bc9c6a87629;p=pandora-kernel.git v4l: Reset subdev v4l2_dev field to NULL if registration fails commit 317efce991620adc589b3005b9baed433dcb2a56 upstream. 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 Acked-by: Sylwester Nawrocki Signed-off-by: Mauro Carvalho Chehab [bwh: Backported to 3.2: adjust context, filename] Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed