From patchwork Fri Mar 7 16:14:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 3792951 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0480DBF540 for ; Fri, 7 Mar 2014 16:14:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 40A4B202E5 for ; Fri, 7 Mar 2014 16:14:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 74C14202BE for ; Fri, 7 Mar 2014 16:14:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753727AbaCGQOL (ORCPT ); Fri, 7 Mar 2014 11:14:11 -0500 Received: from smtp-out-096.synserver.de ([212.40.185.96]:1052 "EHLO smtp-out-014.synserver.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752951AbaCGQOJ (ORCPT ); Fri, 7 Mar 2014 11:14:09 -0500 Received: (qmail 12953 invoked by uid 0); 7 Mar 2014 16:13:59 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 12887 Received: from p4fe60487.dip0.t-ipconnect.de (HELO lars-adi-laptop.analog.com) [79.230.4.135] by 217.119.54.73 with SMTP; 7 Mar 2014 16:13:59 -0000 From: Lars-Peter Clausen To: Hans Verkuil Cc: Vladimir Barinov , linux-media@vger.kernel.org, Lars-Peter Clausen Subject: [PATCH 1/7] [media] adv7180: Fix remove order Date: Fri, 7 Mar 2014 17:14:27 +0100 Message-Id: <1394208873-23260-1-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.8.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The mutex is used in the subdev callbacks, so unregister the subdev before the mutex is destroyed. Signed-off-by: Lars-Peter Clausen --- drivers/media/i2c/adv7180.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c index d7d99f1..1a3622a 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c @@ -616,8 +616,8 @@ static int adv7180_probe(struct i2c_client *client, err_free_ctrl: adv7180_exit_controls(state); err_unreg_subdev: - mutex_destroy(&state->mutex); v4l2_device_unregister_subdev(sd); + mutex_destroy(&state->mutex); err: printk(KERN_ERR KBUILD_MODNAME ": Failed to probe: %d\n", ret); return ret; @@ -640,8 +640,8 @@ static int adv7180_remove(struct i2c_client *client) } } - mutex_destroy(&state->mutex); v4l2_device_unregister_subdev(sd); + mutex_destroy(&state->mutex); return 0; }