From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 913D0C433F5 for ; Tue, 15 Feb 2022 03:36:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233715AbiBODgv (ORCPT ); Mon, 14 Feb 2022 22:36:51 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229975AbiBODgu (ORCPT ); Mon, 14 Feb 2022 22:36:50 -0500 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C244B7EDA2 for ; Mon, 14 Feb 2022 19:36:41 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0V4WYIki_1644896194; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0V4WYIki_1644896194) by smtp.aliyun-inc.com(127.0.0.1); Tue, 15 Feb 2022 11:36:38 +0800 From: Jiapeng Chong To: kbusch@kernel.org Cc: axboe@fb.com, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] nvme: Fix missing error code in nvme_configure_directives() Date: Tue, 15 Feb 2022 11:36:32 +0800 Message-Id: <20220215033632.104124-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'ret'. Eliminate the follow smatch warning: drivers/nvme/host/core.c:780 nvme_configure_directives() warn: missing error code 'ret'. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- drivers/nvme/host/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 79005ea1a33e..53b37f333170 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -777,6 +777,7 @@ static int nvme_configure_directives(struct nvme_ctrl *ctrl) if (ctrl->nssa < BLK_MAX_WRITE_HINTS - 1) { dev_info(ctrl->device, "too few streams (%u) available\n", ctrl->nssa); + ret = -EINVAL; goto out_disable_stream; } -- 2.20.1.7.g153144c