Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1709351pxb; Mon, 8 Mar 2021 04:36:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJyr8siTkT71f3uX9hPMVF6lJqec9Vg3V2/neX4393PbqaD4AHVnVgrRydMBgu4anJNlsjSC X-Received: by 2002:a50:ee18:: with SMTP id g24mr13776250eds.267.1615206998056; Mon, 08 Mar 2021 04:36:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615206998; cv=none; d=google.com; s=arc-20160816; b=O+fD9a46JatOTTYDkvUnFkYlJLke6/sRV13L3x4wan2oo3/7+euatWEuymdH5GfyBk ZVX2vYAEX7UnRd4ykmXJcaC0HQT+Ai2PZQo0Mw1ubGMJERNxs9jKYFnCErjUJmr6Tk74 L7PRvqYJ9yb2KSIcag/Rzd6CK6WpQ0dTGCcbUhNiGarsKvag+0xWz7kDpWG0240yiA56 18i4v0lhL1Y8X1k89kP2R95vJiqM9t+wabDVWCUWmHKFFEw8iJqFAXk0pJJ9o3RO0OAX 6hs5uWvJ5BI9oadjkGYVz8v3QdO8gWr266hjVfxmjKSus++s5an8BVYfpziYg7W03zjv yNpA== 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=4DrBbart23DLtmj6ZLx9sZbvitOTDjE6qLQaNAsw52k=; b=jtwLw7b8NTILBsfefj3TrBoxDOeAsHuKVvA20+fjpHcrlpxfb40ANZDTDT15PUR//1 XS20EWF4d6iGYwc0Qs1mFw4uCp864Yj3ruq1GHaktG1uOhnbuGGTuQ2ZizJwzAbSzxEo Ykc7nbo5Qj4Cuk9BQI+TOvKJVrsk5jJsm7Kof5/CzDI/4hVEjZb3O/Z4aS2vhQuSCbmL 45IowkzRNSIDq/SfZOyp10VZ13VGlcSRog20//cN+TlxO1EL4I6jxo2h+GFnqTB3SGyb u3MWB2ABSNYzvslILJkknx9KsmavfGqXlW4FNbXVYFquovKQbptOL7JHCGy+FACjBnRb RX2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BHvpMgsf; 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 y18si6547882ejp.482.2021.03.08.04.36.15; Mon, 08 Mar 2021 04:36:38 -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=BHvpMgsf; 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 S231946AbhCHMfF (ORCPT + 99 others); Mon, 8 Mar 2021 07:35:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:43426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231626AbhCHMeb (ORCPT ); Mon, 8 Mar 2021 07:34:31 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6B6AA651DC; Mon, 8 Mar 2021 12:34:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615206871; bh=tnoAFpH92WX0AZZAGK6Dc455NpjQPsEbYeWmdW/Y9TE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BHvpMgsftfBjhERwo+5PTBHoHBThCJTB4pCCmdqfmvjjSjh6tj71+174x4fJyQpcU +5wCbWlhPCt2WRrmf3FsJ6UjCgfnz08gJdwf+M9jnRhOUVg/xErG1n6p4iNpM8C5Dh 6iW/Ge3GaES2cR/xm7lo8sRRYQ8Oyrk+gN3Ab05k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, YueHaibing , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.10 34/42] IB/mlx5: Add missing error code Date: Mon, 8 Mar 2021 13:31:00 +0100 Message-Id: <20210308122719.793712314@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210308122718.120213856@linuxfoundation.org> References: <20210308122718.120213856@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: YueHaibing [ Upstream commit 3a9b3d4536e0c25bd3906a28c1f584177e49dd0f ] Set err to -ENOMEM if kzalloc fails instead of 0. Fixes: 759738537142 ("IB/mlx5: Enable subscription for device events over DEVX") Link: https://lore.kernel.org/r/20210222122343.19720-1-yuehaibing@huawei.com Signed-off-by: YueHaibing Acked-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx5/devx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c index 26564e7d3457..efb9ec99b68b 100644 --- a/drivers/infiniband/hw/mlx5/devx.c +++ b/drivers/infiniband/hw/mlx5/devx.c @@ -1973,8 +1973,10 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_SUBSCRIBE_EVENT)( num_alloc_xa_entries++; event_sub = kzalloc(sizeof(*event_sub), GFP_KERNEL); - if (!event_sub) + if (!event_sub) { + err = -ENOMEM; goto err; + } list_add_tail(&event_sub->event_list, &sub_list); uverbs_uobject_get(&ev_file->uobj); -- 2.30.1