From patchwork Mon Jul 5 10:12:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 3734 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Mon, 05 Jul 2010 10:12:48 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Mon, 05 Jul 2010 07:14:47 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OVifP-0001Qe-UT; Mon, 05 Jul 2010 10:12:48 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754435Ab0GEKMq (ORCPT + 1 other); Mon, 5 Jul 2010 06:12:46 -0400 Received: from mail-px0-f174.google.com ([209.85.212.174]:45312 "EHLO mail-px0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754272Ab0GEKMp (ORCPT ); Mon, 5 Jul 2010 06:12:45 -0400 Received: by pxi14 with SMTP id 14so1625385pxi.19 for ; Mon, 05 Jul 2010 03:12:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=NTmHMRiSlAUoZ36fXPyvcoIK+rD38GY/mI913SNzeN8=; b=GX5/d1Vhc3k2oaJg6Yu811EDa/Aqxg8VJQXAfznMdUn0SlSFc9UdYk8abwdRrawnDZ wujv27WOtHo2PB9uc373PKhSe1IIlrMypjG773w8jHj910ptgLus+HBtJsgTSNxoM1Ti Mx7DBrbVT1v98zZ+6ldRtpzPIQ915tS0Ty5Sc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=ewP9jk2jo2Ew5uKRiSpZurB+wg3U5XirF4cNbV4GOw3lxZvCOwXr36M6Q9qEosL8MD SWSE7rGoNH3QwsvZluX1uRQ1Q9Y1LN4Hi875xfqCvOKN4VuvBJ+in/TLBz79HJ8LipGq tw+41Md2kG88n1L1VLwqjbZWtgFsFs+dQmJ9k= Received: by 10.114.59.15 with SMTP id h15mr2884068waa.209.1278324764203; Mon, 05 Jul 2010 03:12:44 -0700 (PDT) Received: from [127.0.0.1] (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id s5sm61945183wak.12.2010.07.05.03.12.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 05 Jul 2010 03:12:43 -0700 (PDT) From: Magnus Damm To: g.liakhovetski@gmx.de Cc: Magnus Damm , linux-media@vger.kernel.org Date: Mon, 05 Jul 2010 19:12:59 +0900 Message-Id: <20100705101259.23155.79936.sendpatchset@t400s> Subject: [PATCH] V4L/DVB: soc-camera: module_put() fix Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Magnus Damm Avoid calling module_put() if try_module_get() has been skipped. Signed-off-by: Magnus Damm --- drivers/media/video/soc_camera.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/drivers/media/video/soc_camera.c +++ work/drivers/media/video/soc_camera.c 2010-06-23 13:43:05.000000000 +0900 @@ -1034,7 +1034,8 @@ eiufmt: soc_camera_free_i2c(icd); } else { icl->del_device(icl); - module_put(control->driver->owner); + if (control && control->driver && control->driver->owner) + module_put(control->driver->owner); } enodrv: eadddev: