Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1053201iob; Fri, 13 May 2022 21:14:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFit1PepMKa5v32CTbh2sX0NVVaEkYRTC8MW4G5Oj5f/07JLKb+URdOylqXq9LDgORjR1G X-Received: by 2002:a05:6000:108e:b0:20a:d9a9:ad31 with SMTP id y14-20020a056000108e00b0020ad9a9ad31mr6086058wrw.331.1652501696025; Fri, 13 May 2022 21:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652501696; cv=none; d=google.com; s=arc-20160816; b=AjNPrtubv8FbcKsVDFn5HujhpR2c3KfDe6eG/j2f+ciKgN6KlXkZX8mZWYDg0afcAs 1GYX6GlUyrGvfwKWDmly9bv6Hp0mvBDtWMJY/zmu4k9EuM9TA8444BLDb3rpxbrh4dMK NV0EqRfv9zmHm0D8DBrmYgM8x3mjh/vZEmk/6WmH6sb0k8vc0wC+99cvk5nCsPRH1gUy HIQrnr4D98X0CNHj4UyvMrhIrl6AflkHu1LZLj4YwtwjVGjFD5wftZDH+Ypmas3SZJ6D 5VYqD/fzDWcN1SkBs7WXFMnaSRnGCb5BfqTCsQemuipvgMDKmFXQlwCzdRJdZwm9bpSD kCCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1Ij2k43ghNC0I+kC6SEB3LI/8jkuuyEkfE5CEj3OJ2Q=; b=V9UJkznw34LniNHOsWlO0pCAaDQNQ0oBgoNp+FEjtcO9daTnkdv0opaVJAN8QHIQRk DWue9cQva+W2Eu1MkEas7+au1mI3GfpWcLl9b45XULiNX4DRovfKVPjJymYSV3aSd6aE 2DgJIf+DgfZ/rYL9SlLYuQFKbtXDTwEFumWAYpi/JoHyPY4I1fDa8qxmOA5i8OZBhRMd PgqveQPoPZORxg2Q+UgmFXlGANlU1WttxiKz9nFn4GJiyShe922aBasztJ3LpdfrF6Iz fA6DDdtpvq+85R5QSZHptr2WMivguQ4bTXfO5N7gO7Pq5UjoUdak7oNLZkyjGjQ69tH/ IJMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="OJ/uTz7z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b12-20020a5d550c000000b0020c731e42c3si3632707wrv.348.2022.05.13.21.14.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 21:14:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="OJ/uTz7z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 68F0F4E6B86; Fri, 13 May 2022 17:46:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235193AbiEMQIf (ORCPT + 99 others); Fri, 13 May 2022 12:08:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235082AbiEMQIb (ORCPT ); Fri, 13 May 2022 12:08:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58A8E4E38E; Fri, 13 May 2022 09:08:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 109F0B830A3; Fri, 13 May 2022 16:08:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B33F3C34100; Fri, 13 May 2022 16:08:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652458107; bh=zfD3VvBeoPFrFgvT7yZssD+YHa8RXtYOmfIAjowEaLA=; h=From:To:Cc:Subject:Date:From; b=OJ/uTz7zYugR1Z4Ld/VIl89CLCjfz0Mwn+01ZMfD1Z0GaO6APk7tT2jfL6+YgjAfU Egfnot0MNZYsQdG33LmCL6ehP86LEyvIHdhQlTFCVP78EM9oiZwIAvEZHB/nQerALw 7hS8C+TPIBKmuGfu0cosCHpC+G3XTS70qWcz80UgdDXegjWrh+70Qi9q3jM4sXw462 8FmqNj0/7xg8hDf18Ty9a1BjpOxBYfOVXJyjQfmrgy7PFqfqerbCdX8wBx3yhsGmCC 9n3MAT72EQxRNfVQlpsEPXk29tea8Z8/tZxZF9ec1H6bVr80zlDQFR4KqOg4V1EFev CMgwJgUC6KaAw== Received: from mchehab by mail.kernel.org with local (Exim 4.95) (envelope-from ) id 1npXq5-0079QZ-81; Fri, 13 May 2022 18:08:25 +0200 From: Mauro Carvalho Chehab To: Sakari Ailus Cc: Mauro Carvalho Chehab , Andy Shevchenko , Daniel Scally , Sakari Ailus , Tomi Valkeinen , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH] media: ov7251: fix mutex lock unbalance Date: Fri, 13 May 2022 18:08:24 +0200 Message-Id: X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As reported by smatch/sparse: drivers/media/i2c/ov7251.c:1381 ov7251_s_stream() warn: inconsistent returns '&ov7251->lock'. Locked on : 1381 Unlocked on: 1377 There's a lock unbalance at this routine, as it keeps the lock on certain errors. Fix it. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/ov7251.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/i2c/ov7251.c b/drivers/media/i2c/ov7251.c index 4867dc86cd2e..0e7be15bc20a 100644 --- a/drivers/media/i2c/ov7251.c +++ b/drivers/media/i2c/ov7251.c @@ -1378,6 +1378,7 @@ static int ov7251_s_stream(struct v4l2_subdev *subdev, int enable) err_power_down: pm_runtime_put_noidle(ov7251->dev); + mutex_unlock(&ov7251->lock); return ret; } -- 2.36.1