From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (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 E0E752BD5B0 for ; Wed, 13 Aug 2025 10:14:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755080083; cv=none; b=R2XxxZVzC3BF3THbdnuhrk+fvmTvxTmh3w/7t310tKy8Y3xm4YOGKwmYPs93RXumtIngDkYqbMSpKctT3X8z1aXuB6tQ35tRE7dJfHFA4r+mSPzC9miPaX9kj80yC9vpEVdw6v7mHzK4NBZOrpuNR0+WiUJodhbNIIrtFmU7Y6s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755080083; c=relaxed/simple; bh=RnVSME/rogwEOBK+j6+fLeml3CKH5bpNmM9U/IxMiMs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DH6Mol9wilNahTfpbosqqgMsUctD2wVvQYNrWxmM0CZIsjH2w1QWaKnl34Y5CXdl/UBM0m59x0f2J13XKTf0MZBaKQJb/Im/lYMf5ertmah8EMgCEcsrnubYkORaSJxMTOUuwJgAj35J0tAUjSZHlU8gM6krvkE/xbP+P7svHqM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=kpNOJvi9; arc=none smtp.client-ip=95.215.58.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="kpNOJvi9" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1755080079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Pv4CHsTtOFzXF65KnF8iE3uf5kBWd2tkurIQwheweOg=; b=kpNOJvi9odUDIJ4dCPRFsQyk6NB2YIK6iRGvUcs8zijAHVZChHLsYUCKdOSn1tYZG5cJ+T IB+5UZ0BismvIn3aKJfozQ9MrRjsocteI4zaEpqsJTAI+EShdOkZ9Uxp3AdylYaoAZX7li 3izek3Sfh7QVt50OKnWzkmkpxKv1nO8= From: Thorsten Blum To: Alan Stern , Greg Kroah-Hartman , wwang Cc: Thorsten Blum , stable@vger.kernel.org, Greg Kroah-Hartman , linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] usb: storage: realtek_cr: Use correct byte order for bcs->Residue Date: Wed, 13 Aug 2025 12:12:51 +0200 Message-ID: <20250813101249.158270-6-thorsten.blum@linux.dev> In-Reply-To: <20250813101249.158270-2-thorsten.blum@linux.dev> References: <20250813101249.158270-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Since 'bcs->Residue' has the data type '__le32', we must convert it to the correct byte order of the CPU using this driver when assigning it to the local variable 'residue'. Cc: stable@vger.kernel.org Fixes: 50a6cb932d5c ("USB: usb_storage: add ums-realtek driver") Suggested-by: Alan Stern Signed-off-by: Thorsten Blum --- drivers/usb/storage/realtek_cr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c index 8a4d7c0f2662..758258a569a6 100644 --- a/drivers/usb/storage/realtek_cr.c +++ b/drivers/usb/storage/realtek_cr.c @@ -253,7 +253,7 @@ static int rts51x_bulk_transport(struct us_data *us, u8 lun, return USB_STOR_TRANSPORT_ERROR; } - residue = bcs->Residue; + residue = le32_to_cpu(bcs->Residue); if (bcs->Tag != us->tag) return USB_STOR_TRANSPORT_ERROR; -- 2.50.1