Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp68680pxb; Mon, 13 Sep 2021 13:09:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9GrFMU8Mg9LS3iaOHKTYJaGBoF/qhq327PgOOkhpw9j0L58AWxuU+so3zM29MjaqI79XV X-Received: by 2002:a17:907:75ca:: with SMTP id jl10mr15300870ejc.302.1631563790852; Mon, 13 Sep 2021 13:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631563790; cv=none; d=google.com; s=arc-20160816; b=qLN4VilLbEC4D9+b+/dojbbPJAQoKD8g1AJXqN6LmDmGFphtH595be1LrpxLsSjGJW Vgk7ynvP7tN7XaX/0fYWbBV7WifHv+89tzzjtl4sdx8AtRdhlwbumswrO5v0V22mZSEl tBqDg0JsIxjkIFU6i07W/+tkIR37eVUcMPKcK6oed3bgDEpaJ2unmOR+W2kiOoub0q2g 79NXbPC9GltYt7yniYixh9Bx956fwNfXgOO+cQtbNh/gSZytTJs+CM7LoepunQV4PK5o b+0AywpoEZvCnNH0r+wQBxekfSSmx9UE0tNBaBN5Gh2HUfnJcHurFKF+RAmc/W+BEf4V WphQ== 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=5diSBiCYh0qArpLcIHEbB3nwfG64rz9eWPOwtiAbZ80=; b=fUlZF9511WWWtAIjj4VBhwtEXPw+lsQF0RQXDtmkIQk8kJuPKtyblwSY3yYtm/jxpm UnO8JnjHzzviq6s7E8I6ZbZQ3IHOFxZ+3Rs6BLEA6yGmCNukS6fS2MGhLXdCl57NcD++ kEfOqD9ENAS0Ra/w5bDQ1YrvBXY3LZqKupi4lv8PskM8lLlAecqdkgz50Xg7TYTbFXa/ 59FgqgG/qbX6vVDCQ1oJUoQ58kvE/YMLU1t/Ab108ifVuzD77ZGbffMmdet6hJxLIsfb tPBZKP/oIkaOe/cQL+jYA24PkJ7p2qDm/s1X3XtwJi8lwQhYMHE0ntmywaSyIFN4lYMK vueQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OxyeMHmH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v21si9708883ejg.618.2021.09.13.13.09.27; Mon, 13 Sep 2021 13:09:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OxyeMHmH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235294AbhIMNtG (ORCPT + 99 others); Mon, 13 Sep 2021 09:49:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:49324 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242396AbhIMNnP (ORCPT ); Mon, 13 Sep 2021 09:43:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DA35961359; Mon, 13 Sep 2021 13:30:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539837; bh=DOzj4Ygmi+FMjr4Fa28O+JHTZ8km7wUXPJlgxXwdLso=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OxyeMHmHeAcJ1e/QpK5E4SW3gDgaUNq3i713e6ruhJWthKZXjuD4unV/pm2tdBI5f ktJW49EL61ifm4f6QmJ19n2eyO6kVquBZqpdXratqaWQ8RdqXHPHpfTzc1FiDZFtNx TWdRHKJEe4KD+7LnE+FneuWDS55noRd/IqaOaoWg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Kalle Valo , Sasha Levin Subject: [PATCH 5.10 181/236] rsi: fix error code in rsi_load_9116_firmware() Date: Mon, 13 Sep 2021 15:14:46 +0200 Message-Id: <20210913131106.531069188@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit d0f8430332a16c7baa80ce2886339182c5d85f37 ] This code returns success if the kmemdup() fails, but obviously it should return -ENOMEM instead. Fixes: e5a1ecc97e5f ("rsi: add firmware loading for 9116 device") Signed-off-by: Dan Carpenter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210805103746.GA26417@kili Signed-off-by: Sasha Levin --- drivers/net/wireless/rsi/rsi_91x_hal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c b/drivers/net/wireless/rsi/rsi_91x_hal.c index 99b21a2c8386..f4a26f16f00f 100644 --- a/drivers/net/wireless/rsi/rsi_91x_hal.c +++ b/drivers/net/wireless/rsi/rsi_91x_hal.c @@ -1038,8 +1038,10 @@ static int rsi_load_9116_firmware(struct rsi_hw *adapter) } ta_firmware = kmemdup(fw_entry->data, fw_entry->size, GFP_KERNEL); - if (!ta_firmware) + if (!ta_firmware) { + status = -ENOMEM; goto fail_release_fw; + } fw_p = ta_firmware; instructions_sz = fw_entry->size; rsi_dbg(INFO_ZONE, "FW Length = %d bytes\n", instructions_sz); -- 2.30.2