Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932123AbbFAJ52 (ORCPT ); Mon, 1 Jun 2015 05:57:28 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:19232 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752038AbbFAJ5V (ORCPT ); Mon, 1 Jun 2015 05:57:21 -0400 Date: Mon, 1 Jun 2015 12:56:32 +0300 From: Dan Carpenter To: Evgeniy Polyakov , Matt Campbell Cc: Greg Kroah-Hartman , David Fries , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch 2/2] w1: unlock correct lock on error in w1_seq_show() Message-ID: <20150601095632.GB897@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 959 Lines: 25 Smatch complains that we don't unlock "master->mutex" on this error path. It looks like it is a typo and we unlock ->bus_mutext where ->mutex was intended. Fixes: d9411e57dc7f ('w1: Add support for DS28EA00 sequence to w1-therm') Signed-off-by: Dan Carpenter diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c index 3351be6..79ecaf8 100644 --- a/drivers/w1/slaves/w1_therm.c +++ b/drivers/w1/slaves/w1_therm.c @@ -412,7 +412,7 @@ static ssize_t w1_seq_show(struct device *device, c -= snprintf(buf + PAGE_SIZE - c, c, "%d\n", seq); return PAGE_SIZE - c; error: - mutex_unlock(&sl->master->bus_mutex); + mutex_unlock(&sl->master->mutex); return -EIO; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/