Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1547049pxb; Mon, 22 Feb 2021 05:04:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxv6rMvsevmVh+D4gGT84dnD6fuK5J7T8TlyV2SboFCefpx81vcpL/0lX1BrQT5PHykbqW1 X-Received: by 2002:aa7:d38e:: with SMTP id x14mr13826931edq.127.1613999055705; Mon, 22 Feb 2021 05:04:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613999055; cv=none; d=google.com; s=arc-20160816; b=qJ8VPjr3Q6+HF2YZW3TQ72l7qBjSNZpQ1wByOO7GIrA6JBofnDPX7+0oAutNXftgN5 s2DZvQIWXXqoh0+zmWCeQv3Ioc6O5W6a72eIF3sFyDp4XclMLGqDqNrAFEBS/xG/1K7y 6mbCaGbk601mAJ0C+4WKAgrTcHUwqH37BPVo2/GnCSzTUS2ZvHL4Sa1JZaOvwtSBwDDh ZN6kZzW2EXTnyUvAxJWyfHU5UZI797npjx74uhmYgZw+coFFX1d+NgkOccYvLRm5VVP2 g0l6wdQmZwIFViJf2BrnlNd5CHoQRajsRc7Nhvky0v8n++yx8xvPu8V0SQVj6Cyzacjv BTmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=CCHVGsuMfQZ0f0LTfL0qnbqcitWdKi3jjb1q4Fpz0Z0=; b=nK3jGQwcjN+iwgnPOELs/nGNOQNmaUu3CLMKeIa6nGQOSeuTKmcMHm3RLQ7wseQSFq ePybAG8vYd9AdJlOGxR2DHRXm0cx/a1E8kYMXkQu3f4srjBLVk8+WsWzcC0yBm3+yyy3 wARU6vX4hRACVfjuhoFREOh+r8obGBLF/HQBmd1wpAiVHurktfyO0FTCDhRyh/9r9sjo p7Cku1uDQIehcU6khQzZseymzMW/wCgJHjhb1ytSktik53+L08o5D5AXf7B1SWRzwumG 93sJbsIdL4LJlUS6STyE0M0gJlYmGnJJpb8LeSoHtXq4imW1caj7aTJqimL7aptS2uAH 9nfg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r21si12910375ejo.123.2021.02.22.05.03.49; Mon, 22 Feb 2021 05:04:15 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231676AbhBVM77 (ORCPT + 99 others); Mon, 22 Feb 2021 07:59:59 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:12635 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230270AbhBVMZO (ORCPT ); Mon, 22 Feb 2021 07:25:14 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DkhCP5tZfz169fZ; Mon, 22 Feb 2021 20:22:41 +0800 (CST) Received: from localhost (10.174.179.96) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Mon, 22 Feb 2021 20:24:08 +0800 From: YueHaibing To: , , , CC: , , YueHaibing Subject: [PATCH v2 -next] IB/mlx5: Add missing error code Date: Mon, 22 Feb 2021 20:23:43 +0800 Message-ID: <20210222122343.19720-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 In-Reply-To: <20210222082503.22388-1-yuehaibing@huawei.com> References: <20210222082503.22388-1-yuehaibing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.179.96] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Set err to -ENOMEM if kzalloc fails instead of 0. Fixes: 759738537142 ("IB/mlx5: Enable subscription for device events over DEVX") Signed-off-by: YueHaibing --- 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 ebc2a4355fa5..3c8e6a25465d 100644 --- a/drivers/infiniband/hw/mlx5/devx.c +++ b/drivers/infiniband/hw/mlx5/devx.c @@ -2073,8 +2073,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.20.1