Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp934036pxb; Wed, 6 Apr 2022 04:43:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtpeQHMkihNtouLoMd3xGb4C7k5XO+/Gcuzy6J3kuptrKxY1c5cDrHGWO/KUslmnhscq7B X-Received: by 2002:a17:902:e885:b0:156:b4e6:173c with SMTP id w5-20020a170902e88500b00156b4e6173cmr8114595plg.161.1649245427706; Wed, 06 Apr 2022 04:43:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649245427; cv=none; d=google.com; s=arc-20160816; b=K9TxC3sQxShcrta9oZNDTKJEOYitNcbSSpmcrDk+AmhwvJkJSvIFY18z7rs0QbdVhQ EdTm/d3GfVJu3ljkkJUA4MUiL78/WxgfJCHRe6jH4idpdfVUqo9ZXGi6RbeC6K1cgrVF d12E9eqUS+q3irz/VQHh/fp+Ep+0wfFJlxVY0tvY6jssnkmvkFak/csug62LkHHGyvT8 QOfveJYpgDLDGFax5tsaHA8i7x07Ospb7+s2E08kTOl0hqjX9JM0WZov+Kq4Q51ntbSq N/O397xUjbSYkV/sYFoRXkdjuS9X8ojRlHzoTpEL4aq3RP6GsG1FYqcuJ+ciEiYL8qIF /k+w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jk4t8fqSn/Ge/78wC19KIJT3c4S3szbheXvX5LIINq4=; b=difH3UXfQMlAi8fSdkrDWAHQz5Wg3pHEcX2DLQ3lMurDsfmssniFE9Sv6WhbwFzo7k OYNqCe3fI4+c2nNMSKpbX2Zp54+vGQsYlo38WeC5rUmCHHvNr7T0B0FXa8SjkXmTaRhz 9iANt+MPfFA4eR9CA6Y8yx4mJnjiXuTyxrBo0AZdQB0ztb7kWjKxOvYLlk0mJEnMBML2 ARcq04RS0fUEMAAn/fVfYR4YLV5AspUQk1SKYOvucZIZB0uRb9FJRqlW0W4yuT90DsHi rm1RckQvByFqvJ4t5tINbMOuRsU7CNcOGW5lxvnzOgozaV9goVJOYw5wtIWrz6JKdoI6 l1Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gJRrKZ2s; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id bc20-20020a656d94000000b003836f6959b0si10808384pgb.522.2022.04.06.04.43.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:43:47 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gJRrKZ2s; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CD54761BBA5; Wed, 6 Apr 2022 03:00:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1580889AbiDEXez (ORCPT + 99 others); Tue, 5 Apr 2022 19:34:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349259AbiDEJtb (ORCPT ); Tue, 5 Apr 2022 05:49:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6969423173; Tue, 5 Apr 2022 02:43:18 -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 06737B817D3; Tue, 5 Apr 2022 09:43:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F48FC385A2; Tue, 5 Apr 2022 09:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151795; bh=CSM//Rz3PDHvzk+BYq71+X+1Jm1t0/cBCElyGnnl1/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gJRrKZ2sGQ2ab8IX9LMYQtNjE8d642V+RK43pBndTEe4Yzd5w+ZNMVTHU2Ysk0eHU PsKZbMlERSGMgsGbtsBCb+lFbSHqViD9M0wxYGtoBBSDkAhoBmQd7sLRpYGo0txnng FM5EkSyuIq+Jkl9EfY4Nt/ij4qCSJZo81POwJTv8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern , Dan Carpenter , Sasha Levin Subject: [PATCH 5.15 545/913] USB: storage: ums-realtek: fix error code in rts51x_read_mem() Date: Tue, 5 Apr 2022 09:26:47 +0200 Message-Id: <20220405070356.185550015@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Dan Carpenter [ Upstream commit b07cabb8361dc692522538205552b1b9dab134be ] The rts51x_read_mem() function should return negative error codes. Currently if the kmalloc() fails it returns USB_STOR_TRANSPORT_ERROR (3) which is treated as success by the callers. Fixes: 065e60964e29 ("ums_realtek: do not use stack memory for DMA") Acked-by: Alan Stern Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220304073504.GA26464@kili Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- 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 3789698d9d3c..0c423916d7bf 100644 --- a/drivers/usb/storage/realtek_cr.c +++ b/drivers/usb/storage/realtek_cr.c @@ -365,7 +365,7 @@ static int rts51x_read_mem(struct us_data *us, u16 addr, u8 *data, u16 len) buf = kmalloc(len, GFP_NOIO); if (buf == NULL) - return USB_STOR_TRANSPORT_ERROR; + return -ENOMEM; usb_stor_dbg(us, "addr = 0x%x, len = %d\n", addr, len); -- 2.34.1