Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp330658pxb; Tue, 19 Oct 2021 03:55:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvRF+wkFbfFBVUdFzEmO5agU+Z9vzV7IBCLlYvSmR3S5HRhRFop14nljCfMdmvz1PSACm2 X-Received: by 2002:a50:e60a:: with SMTP id y10mr53009513edm.233.1634640958058; Tue, 19 Oct 2021 03:55:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634640958; cv=none; d=google.com; s=arc-20160816; b=MqgZ7nmr1rtaAaPdN83IapEi4iSuqQwwX5njewZhMY6djYL4GSzLG2dcPLESMvubxl G2+BndYZBAQrAgqeCvhrnAcOAySB5mbtJrnpeRmluGUs48cEd6uBhOdSoVcGUTg75ulX KG6XsJTF1EZeTAEtSv/kAltf+Qvosxn/w84nUgEm0sXCf2dPCumuJGQBY4d7e6lTvJfR sNcvWRWk/lYqFK0N1p/hRjf0mDOQmB7y8uY+ffszDczt0oJB76CZ0O58/q9bUbVks7xK VHD7SGu2uKfpWeYNoRRHXCbmsMehF1ULw15EpXC7MPLopzb175cFz4CmuXLVL5H06fN6 52Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=P5DzvOL2z9U2oh8Mgk43d6OH34DeXx3P3CZX9ULxuRs=; b=SIJ/7pxTK1iL/xY6vjS/dAWh3YqKKHtEQncHWhdsGxL33mcvIqbXhoGU5UhNuyj9u0 XJhY867ftHrZGaRi9SxVFVGPP4eMXzAeiH8n9fpoLhQB/6t46C+UvkljmduxFDwcB+l0 7fe3QQtxf7PRMTsg9625JkoT8xCYqXOhbhYI8zwhvkRUlcwz69jQA+J0lA8iXtr61L/D 2HkFDspcUwRMBKC1wPIvG2yPWgRVrKWN7nZOMoMDae4E0C/GY9Ws9Vr/SvZaN8RZLRjY 0uynUD5HmaBPwc0NcILkOgfIKn7lc+8hedm3dkgo10QiZsQyULly9FpytoI8lEet7Zx6 dsGg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h15si21754776ejj.98.2021.10.19.03.55.33; Tue, 19 Oct 2021 03:55:58 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235167AbhJSKzr (ORCPT + 99 others); Tue, 19 Oct 2021 06:55:47 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:36964 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230097AbhJSKzo (ORCPT ); Tue, 19 Oct 2021 06:55:44 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0Uswb3AN_1634640805; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0Uswb3AN_1634640805) by smtp.aliyun-inc.com(127.0.0.1); Tue, 19 Oct 2021 18:53:30 +0800 From: Jiapeng Chong To: kashyap.desai@broadcom.com Cc: sumit.saxena@broadcom.com, shivasharan.srikanteshwara@broadcom.com, jejb@linux.ibm.com, martin.petersen@oracle.com, megaraidlinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, chongjiapeng Subject: [PATCH] scsi: megaraid_mbox: return -ENOMEM on megaraid_init_mbox() allocation failure Date: Tue, 19 Oct 2021 18:53:20 +0800 Message-Id: <1634640800-22502-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: chongjiapeng Fixes the following smatch warning: drivers/scsi/megaraid/megaraid_mbox.c:715 megaraid_init_mbox() warn: returning -1 instead of -ENOMEM is sloppy. Reported-by: Abaci Robot Fixes: dd00cc486ab1 ("some kmalloc/memset ->kzalloc (tree wide)") Signed-off-by: chongjiapeng --- drivers/scsi/megaraid/megaraid_mbox.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index 14f930d27ca1..d98b223eab9a 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c @@ -712,7 +712,8 @@ megaraid_init_mbox(adapter_t *adapter) * controllers */ raid_dev = kzalloc(sizeof(mraid_device_t), GFP_KERNEL); - if (raid_dev == NULL) return -1; + if (raid_dev == NULL) + return -ENOMEM; /* -- 2.19.1.6.gb485710b