From nobody Mon Nov 25 02:48:32 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A69401F4738; Wed, 30 Oct 2024 15:32:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730302330; cv=none; b=SdDDWIJtVVytC2sqBDcxslQAF7gBIGseiERdjXHGVv7ZeSN2BEjxzlDlYShyVAbqeCS18Y+kxF9zv3xWsDzjAMtap/4UajlGRd88700zGgFOC++MZULm5F1u8n9KonHqOG5cFRjgmzCq5h5n0f3wldNRl2qdYOxdyEIVDn3VTlo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730302330; c=relaxed/simple; bh=Espd9A6FO3Obk0zAkvp6qR5Nh3+IenL+AHa+mvmmXf4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YVoY5kbU66wgSZCUEyGoroYICiPKMOdT8JSZM3tyFikZA8Wn39PDeJVRqqGiyZnJx4EfDmYj5dr0X5jyR9VRLDI8XXfLGBKNTp+lTdwkaEisVqI/RDFqqLGmElUBEHzsdj2Ez3t+UZm+8tVwgnsVfu4heLxJZsx9Lfb6NsCBPnc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=JNdGOsDt; arc=none smtp.client-ip=198.175.65.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="JNdGOsDt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730302329; x=1761838329; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Espd9A6FO3Obk0zAkvp6qR5Nh3+IenL+AHa+mvmmXf4=; b=JNdGOsDt5JfHJeg0bc/dmKHv7wI3FHxL3EUAghmKrQsM9GI7Tl+Qx80O osfag/X3y1KQ3Qg4dyWymXp/Um0QlcQZR4efrI1X1rs/E5rnCsRx9Posk X8R74f4APtXuWUdhY2FKsdsGOLHo5JTO3Id8pIGF3J20/eNlkfIqg0AU+ 0G4v241wJz1fTS+j2+bHyQZ28K79uI9+1q2jCUK+Uy+Rua48tHCB5AjM6 DPxIChlXR7PAJo8VWb1I3f1Py8/LNb1e41MkKOBFRjdVfXO1HxaP30YR9 Rs9jjeeWhKGeUJTJXfeaX+a6RT3MZFxI8sQxJQYfwCSNdVX7+QucbIRVb g==; X-CSE-ConnectionGUID: MEo1rujSQ0q086ldahx05w== X-CSE-MsgGUID: BPw9chXhRZadFjk1Dgv54A== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="33699868" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="33699868" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2024 08:32:06 -0700 X-CSE-ConnectionGUID: 54MBBOPQT+qQtlEwvbBsww== X-CSE-MsgGUID: DOt4cGQtQ9OxA5AcEJBVbA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,245,1725346800"; d="scan'208";a="82514081" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 30 Oct 2024 08:32:03 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 789301CF; Wed, 30 Oct 2024 17:32:02 +0200 (EET) From: Andy Shevchenko To: Mary Strodl , Andy Shevchenko , Wolfram Sang , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski Subject: [PATCH v1 1/2] gpio: mpsse: Check for error code from devm_mutex_init() call Date: Wed, 30 Oct 2024 17:30:26 +0200 Message-ID: <20241030153201.2078266-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241030153201.2078266-1-andriy.shevchenko@linux.intel.com> References: <20241030153201.2078266-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Even if it's not critical, the avoidance of checking the error code from devm_mutex_init() call today diminishes the point of using devm variant of it. Tomorrow it may even leak something. Add the missed check. Fixes: c46a74ff05c0 ("gpio: add support for FTDI's MPSSE as GPIO") Signed-off-by: Andy Shevchenko Reviewed-by: Mary Strodl --- drivers/gpio/gpio-mpsse.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-mpsse.c b/drivers/gpio/gpio-mpsse.c index 3ab6651d2226..8fba0779ae17 100644 --- a/drivers/gpio/gpio-mpsse.c +++ b/drivers/gpio/gpio-mpsse.c @@ -430,8 +430,13 @@ static int gpio_mpsse_probe(struct usb_interface *inte= rface, if (err) return err; =20 - devm_mutex_init(dev, &priv->io_mutex); - devm_mutex_init(dev, &priv->irq_mutex); + err =3D devm_mutex_init(dev, &priv->io_mutex); + if (err) + return err; + + ret =3D devm_mutex_init(dev, &priv->irq_mutex); + if (err) + return err; =20 priv->gpio.label =3D devm_kasprintf(dev, GFP_KERNEL, "gpio-mpsse.%d.%d", --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Mon Nov 25 02:48:32 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A01B1F429A; Wed, 30 Oct 2024 15:32:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730302330; cv=none; b=X7K3is+USzYTE7oXSrfuerQGAszja9uoIDjuS/jC6e5tjF5ki73+3GjNBOukGxQv1W63DhhBdD3qTS74/pTG9zffYDIoj1v4msJjYGX4aN0w/Njtd6RAj5NOXjZYfa3IBJVTfXTvwdMLqsqMU227Edd5kzZoiLYQiCsMQNlUfEk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730302330; c=relaxed/simple; bh=XkRyR4vb8NiO1sAqWwgBmOjrmW7ZkuprxDvtvUi+zfo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O5tp3U54UUTBvqjoLSF7McSw4ASDmAHPN8o6g66GZnUyPsAtFMdjsr8iNglLgKnfdCeNzx3bVwDfuqqh0YrrW++rwfjIl5XR+hRFqMr5nIca4/aLDZbayvbFxBYaq02DdjckIPnAl7LKCVIX1RzYT26VMFLdUMvsyw877iB8DnY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=BK4/xtV3; arc=none smtp.client-ip=198.175.65.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BK4/xtV3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730302329; x=1761838329; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XkRyR4vb8NiO1sAqWwgBmOjrmW7ZkuprxDvtvUi+zfo=; b=BK4/xtV32e8up877BPnZB9ByNJMvlKmLkY1DtXQ3uXMB+Fl7CopYZVDY QTiet9SENkbn2wXXqmkSbGOafTfrOdoG8RpaFhjrkawgxtPLNBEaLFkmh mGHXpAVR0HHjtGmyx04FvFO0C3qU/SkHmHJWb0rsiubz4lDx1WIzH3mVP xgPjNI2DQRMFpCkfIUVjLmaQaFakGHMn1pZC5wK4qTS66Q9bAXBWYcdt1 D/7Ez31wjIbtDuwUYhtrW0JbD7C9LCEyAer51GojzVg1rEi/zVwArdlqT /jyw316dcQQEqCRykMsFItxBzb9ZzTls42ZvrA0kDti65mhzn7JXhbdfR g==; X-CSE-ConnectionGUID: nz9j6NUESZ2ZvIvqGAk/Lg== X-CSE-MsgGUID: /U7oLxl/S8u4yDLXCA66JQ== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="33699860" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="33699860" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2024 08:32:06 -0700 X-CSE-ConnectionGUID: hxoW5s/rRemcHwYTPSYtBw== X-CSE-MsgGUID: wcDxARzQTJOMEig83mkuwQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,245,1725346800"; d="scan'208";a="82514082" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 30 Oct 2024 08:32:03 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 873172A0; Wed, 30 Oct 2024 17:32:02 +0200 (EET) From: Andy Shevchenko To: Mary Strodl , Andy Shevchenko , Wolfram Sang , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski Subject: [PATCH v1 2/2] gpio: sloppy-logic-analyzer: Check for error code from devm_mutex_init() call Date: Wed, 30 Oct 2024 17:30:27 +0200 Message-ID: <20241030153201.2078266-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241030153201.2078266-1-andriy.shevchenko@linux.intel.com> References: <20241030153201.2078266-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Even if it's not critical, the avoidance of checking the error code from devm_mutex_init() call today diminishes the point of using devm variant of it. Tomorrow it may even leak something. Add the missed check. Fixes: 7828b7bbbf20 ("gpio: add sloppy logic analyzer using polling") Signed-off-by: Andy Shevchenko Reviewed-by: Wolfram Sang --- drivers/gpio/gpio-sloppy-logic-analyzer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-sloppy-logic-analyzer.c b/drivers/gpio/gpio-= sloppy-logic-analyzer.c index 64f2ca4a72b2..8cf3b171c599 100644 --- a/drivers/gpio/gpio-sloppy-logic-analyzer.c +++ b/drivers/gpio/gpio-sloppy-logic-analyzer.c @@ -234,7 +234,9 @@ static int gpio_la_poll_probe(struct platform_device *p= dev) if (!priv) return -ENOMEM; =20 - devm_mutex_init(dev, &priv->blob_lock); + ret =3D devm_mutex_init(dev, &priv->blob_lock); + if (ret) + return ret; =20 fops_buf_size_set(priv, GPIO_LA_DEFAULT_BUF_SIZE); =20 --=20 2.43.0.rc1.1336.g36b5255a03ac