Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1707698pxb; Mon, 8 Mar 2021 04:34:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxiukUPqxvsZka9T4jRawA20A5Xz5o0qA4GkRXMDKzH6ez0IBpV0FgnvYtfqk8qhYrHyJyH X-Received: by 2002:aa7:d2d5:: with SMTP id k21mr21376924edr.216.1615206853268; Mon, 08 Mar 2021 04:34:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615206853; cv=none; d=google.com; s=arc-20160816; b=XNOc4IFaF8y1nZXlB88HUdItI4NkFO0l7MOh2X9Al2o1LwloPqP43G5LO1Fhf/lDR3 Zw4WpMik1vTv4DjmNrpDMlVGPP3zmPGMvhf+DMmZ0s7XswOA9Z5BCBIi1ARc2t1VHpGF 6ZFLYaKAjj+9dBWPA8ygb+i1DJYDESgjgswJMiM9oXk6wItkUf/k7PhMA/XhAPg82U6J Xt5rAv0bKPmKGI0D9ckJvYUfl/ywTO6b9+gnKOH5MsN6Lwwx2TJYmJrXEQ9qxOeZo9aP mJHaSMqXbFm5GPtO16cXV4ZHYo0wBI4NF77dsirwjwJGy9yuMLHPxjaVDmLMVPy7P6Qv 3ICw== 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=TNWffpTxDHsrysfQ9iZWUb7Eb3r/htXun9kXCt6AqDs=; b=dW4NUSIPd025Oz8odYvxeWApmqoYw3IKsLzYS/66/ovr3ZwvAQVyfUrxWfKpmB2GtT bYgrTdr44Vsh9FBkG0a0coEAuevp8RPnqg3xlfdEA26YMrLMfRrWUbUpZhDDZUrM/xfU Q4Fv8Z9s4LdOSRej7o4+4ibuWdHDyRhHK6iBYyhDqPGC5C6kJNSUe9KKPz1hmu822eKt TvgSslsXAKKmi3cM8qw4OzDulCGJnSryTeFQlqC3mK+i/sazCK/3jP8ijSB9TSmcq1wz YBZZakj66TmOxijpbX+NC7mZMi5nICjnqdFJ5UqjZ5kWgV9IQgpGaq8ddlWjap60B9vY +1sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Xvt/yrzN"; 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 i19si6865142ejd.152.2021.03.08.04.33.50; Mon, 08 Mar 2021 04:34:13 -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="Xvt/yrzN"; 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 S231532AbhCHMbo (ORCPT + 99 others); Mon, 8 Mar 2021 07:31:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:40606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229701AbhCHMbW (ORCPT ); Mon, 8 Mar 2021 07:31:22 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E004E651C9; Mon, 8 Mar 2021 12:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615206682; bh=QnYbkgD8aclNv4Rh0U4euC6yqpGD1SRB3pG+Ax5/5OQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xvt/yrzNHRhH1XyL3c1qaRe1R2urVyWip11+51cjhoBnsuWxL8eqctThKjo5ZA8E/ GgL4zrpar2FNrfzQCMUNmevtol5iDyX6Ef6n2Q1XDJWiq/I1qIBWbYx8NzTcMNLLvl fBBvFlhmU9YDoH3o2tVptQFX4Z1PK/vOBglOO8BY= 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.4 18/22] IB/mlx5: Add missing error code Date: Mon, 8 Mar 2021 13:30:35 +0100 Message-Id: <20210308122715.277432170@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210308122714.391917404@linuxfoundation.org> References: <20210308122714.391917404@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 4d6f25fdcc0e..664e0f374ac0 100644 --- a/drivers/infiniband/hw/mlx5/devx.c +++ b/drivers/infiniband/hw/mlx5/devx.c @@ -2022,8 +2022,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); if (use_eventfd) { -- 2.30.1