From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 A04DF26ED5D; Sun, 7 Jun 2026 10:39:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780828785; cv=none; b=Wad8NMF0HxKJUBtqRTqztFrkdnPlkiZi5yqFlgbQNuYZmZZmpbfp189Wiq2fgy//J95Ci5kv1O9IQg5yZWT00hAzdHEsHGq3CgD8Q+G4fohp0nvuLiv8AGAG66CkqSkxtPzDhYx+k/23CFzFbUuiclpKEPJDoYRDPBZfNJMxvGs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780828785; c=relaxed/simple; bh=R+knhguAC4rqb+GZ0FyAePOTn6NO/vXYivT3zlwZark=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=e5HxLU/za11GCf/OnHFMZCa88W+9FsjwshesWnKtBkhnqIQxXJkflF9Ok3z318yFEVWsL8JBjvlx+LOY8o0zdFO5EHoxM+kNMkn3nhmGiVmaWR37hW4etGdMNP6/j2lHA70410mYOCmY/y8AeIDkbI+yyrVLNh39KZY2mkeSbsE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HCf3pswj; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="HCf3pswj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4F1E1F00893; Sun, 7 Jun 2026 10:39:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780828784; bh=aaxe+tWhnThRFLhrvQWdmrIr+lVGF9FMmlFo8JrlsyE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HCf3pswjaBjrsFzkpVcjiC5nAj+/3si8WPlA0SQoFPFAzOJH+RB5GqZ7OL5s38BZq 9XdLSczpKiKfk2WGJuQAg2x2KQnemk8duEtDMem0I6sh3lKmuHq/HzqaB14t85aMk/ Dcyq35h1VuzEyJpJ1NKnW7fRP15CfaanEvruGlv8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Salah Triki , Joshua Crofts , Maxwell Doose , =?UTF-8?q?Nuno=20S=C3=A1?= , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 6.12 168/307] iio: adc: viperboard: Fix error handling in vprbrd_iio_read_raw Date: Sun, 7 Jun 2026 11:59:25 +0200 Message-ID: <20260607095733.894380958@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260607095727.647295505@linuxfoundation.org> References: <20260607095727.647295505@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Salah Triki commit 422b5bbf333f75fb486855ad0eedc23cf21f3277 upstream. The driver proceeds to the reception phase even if the preceding transmission fails. This uses a goto error label for an early bail out and ensures the mutex is properly unlocked in case of failure. Fixes: ffd8a6e7a778 ("iio: adc: Add viperboard adc driver") Signed-off-by: Salah Triki Reviewed-by: Joshua Crofts Reviewed-by: Maxwell Doose Reviewed-by: Nuno Sá Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/viperboard_adc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/iio/adc/viperboard_adc.c +++ b/drivers/iio/adc/viperboard_adc.c @@ -70,8 +70,10 @@ static int vprbrd_iio_read_raw(struct ii VPRBRD_USB_TYPE_OUT, 0x0000, 0x0000, admsg, sizeof(struct vprbrd_adc_msg), VPRBRD_USB_TIMEOUT_MS); if (ret != sizeof(struct vprbrd_adc_msg)) { - dev_err(&iio_dev->dev, "usb send error on adc read\n"); + mutex_unlock(&vb->lock); error = -EREMOTEIO; + dev_err(&iio_dev->dev, "usb send error on adc read\n"); + goto error; } ret = usb_control_msg(vb->usb_dev,