Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9083596pxu; Mon, 28 Dec 2020 06:14:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9V2sgI/ME/XtmCCHZS1KAdri1bHWt67Wv2CmzBnGGb4oBTqpUjIgcXhY+JOhaOj9PPi6K X-Received: by 2002:a17:906:9588:: with SMTP id r8mr41052424ejx.148.1609164864253; Mon, 28 Dec 2020 06:14:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609164864; cv=none; d=google.com; s=arc-20160816; b=XgfHoVyfAQVLutMLYUPgnsB6faKUm0tFBv+RthsPBoNAy5U2Lujyvd8oaHOuvLQXMi TkqhHKLxIi+HLMlflXMYYQIOHYWANxeyA8PHBHgX1akVYuvg3fXlzdaARxpwfUIpU8C7 8KB/G6T1wVucCd+bGRJ1sOkFEUU4Gs27FMStTLb6rv+QPhQSLhG55MqG9Q4IEI+FUY2y 1+j/YRfkIG5FSjlhqJMsbiiqRmJ+yi9lYUUmuPmWOsxX1X6iLn/MvKqmAMFPKQ8jFw/J Te1QsKnarscbtwBF8MJVdNhkY6fcE/0vVyjnBW1vlckioxtEQYNbY92VaT7nW3sHsXN4 WLvw== 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=t7yc+321yQuTmHASVogAlkg4+xmOTjjMdR7NK7spDKQ=; b=ibtrV3xLb/AxsKJB/6zLMxBX5m42jAjN8Sb6X4aBKP8g5nxQVr2IBepQr2umF3Bg+C uX8P0ycUTUCd0KnU8TAkBLO8SXIGXgW5ALY+TeCOuwKXWQ4NKuBB8ZhIy3ZbcoJMeTOX zG21dhWUlPGgn770bKfxbZWUUY+14wrbS2UOgjPkzl95odJ/WakmjD9c7x9KVHcFrQQ2 W27NKt12YJS4AEgNlMXkTfsJWveJRItvSoGVEp39LaSt595SgPzo8wfFwLqciu53T9Da yGyVk58j1/dj63gnhHb+Lwb4IvJB25g04rbDJZpbMBlugAnjabISWadh+If4MDbac8ch QVyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SV1o7yKV; 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 hq10si19128136ejc.616.2020.12.28.06.13.59; Mon, 28 Dec 2020 06:14:24 -0800 (PST) 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=SV1o7yKV; 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 S2439809AbgL1OML (ORCPT + 99 others); Mon, 28 Dec 2020 09:12:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:46728 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439799AbgL1OMI (ORCPT ); Mon, 28 Dec 2020 09:12:08 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id AA57020731; Mon, 28 Dec 2020 14:11:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164688; bh=2Tw21TPD1Uwl+bEFsk0SfZcRs10gCBw9jO8JwQi/jL4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SV1o7yKVs7eSfxgqV9jFxHuw1hSV81nbBye3hLyqrTxBmM+aF5fxxKNIoXscqsc0d woAqNwPTrJ4F8untR8m46LjIlxSOnt8mCbWYyR0gj7k243W9EMlPYXqGLDIBxDUM7w ec+HfHAmDHsw126bdJPY8piPvcBUPmsyIgFXJ6Vk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Kalle Valo , Sasha Levin Subject: [PATCH 5.10 262/717] ath11k: Fix an error handling path Date: Mon, 28 Dec 2020 13:44:20 +0100 Message-Id: <20201228125033.556096472@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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: Christophe JAILLET [ Upstream commit e7bcc145bcd035e56da7b97b033c463b32a5ff80 ] If 'kzalloc' fails, we must return an error code. While at it, remove a useless initialization of 'err' which could hide the issue. Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Christophe JAILLET Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20201122173943.1366167-1-christophe.jaillet@wanadoo.fr Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath11k/qmi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c index c2b1651582259..99a88ca83deaa 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c @@ -1585,15 +1585,17 @@ static int ath11k_qmi_fw_ind_register_send(struct ath11k_base *ab) struct qmi_wlanfw_ind_register_resp_msg_v01 *resp; struct qmi_handle *handle = &ab->qmi.handle; struct qmi_txn txn; - int ret = 0; + int ret; req = kzalloc(sizeof(*req), GFP_KERNEL); if (!req) return -ENOMEM; resp = kzalloc(sizeof(*resp), GFP_KERNEL); - if (!resp) + if (!resp) { + ret = -ENOMEM; goto resp_out; + } req->client_id_valid = 1; req->client_id = QMI_WLANFW_CLIENT_ID; -- 2.27.0