Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp380796pxb; Mon, 25 Oct 2021 10:04:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJye41fpjaqp0aICcfMsLSSIQGv/xCXONfBluM3M4y+2HG2mMEBVULyRC+dJR1B6v2Mxmayq X-Received: by 2002:a17:906:26da:: with SMTP id u26mr23877379ejc.315.1635181486308; Mon, 25 Oct 2021 10:04:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635181486; cv=none; d=google.com; s=arc-20160816; b=nU7lx/W+06+QabylxHUFKrQdwUeSqkbGprq+Iz0I8nXa1rjn/ySlHQ+yLue4bhFSo1 N1pLC3gePRsfcepMngLyzxIbHkMVuziUMXc23iqPg4rjdYdpF6Xs4HnZbfa5R49S/gIu N3NzXYR2To/UKzyN5ev39OPGJfzCrdATtHinKk9ScfAzRs/WjByjE4HKT3tFutklNEVb t9wvFaLJqPBra0SvjPkf+kb3hdR4Ln4IgFIqNBRckBjVtxsiSuwUSfmiopILSc5ffGmk SSBIuTEQtSJRM+SrMatcLaRty3P/glO7zdJnGnSOEyuZMNRZYTuWml8CmRXlnk/s8bQN d/wQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=57WW1Igr9RJEW/4HmCpsgsvzu+C/NDjuhDjBZwYLeNo=; b=A6iRgVkPDIgL5I0Urg9dAo98ePqw5bDX7RI3Vhzgu+W32+91iGYFsjhUYqiVQwV2K5 j2srTzQ2yVdxCgm4/e6Tog5sCnOBT+j2fjAQvJO84sEEkUnX6xNZXnU/NvgK38fenGtU 0GMNnWxt+ZK35LUI1q8ep2UqmfjdsSO8bVxOFi9LR33xIgF6a4P2/xRKO2I+odiLRO56 S+HEbT7A4SYU1pnxCnnRbU8OZRiH5VQ4bC4rmrMZI2W9/Yu+bYeFunHbLSmjEteGrx+s HGqzOmxEv4HSNi3tqsEtkjhDifqkupshNdEAcktkUxUDyak1Pt29P1oHYBpVx8f74CEE AWWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="q0l/iyJv"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r19si1530952edw.446.2021.10.25.10.04.08; Mon, 25 Oct 2021 10:04:46 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="q0l/iyJv"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234313AbhJYRCn (ORCPT + 99 others); Mon, 25 Oct 2021 13:02:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:54932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234264AbhJYRC3 (ORCPT ); Mon, 25 Oct 2021 13:02:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 406FD60EE3; Mon, 25 Oct 2021 17:00:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635181207; bh=k6hRgrW1wvRBZh7M1MsTSIZZUcz0slUi4Br1HntwG1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q0l/iyJvjENm7b/0dXw6qg+NY/jhSszxFPEEQ0RVABmiz4SNz1hRbOdPGwJ+fchri 2eu9a6QtDkkE8PRkP86Fr+WEaQqIeqmPu3lCWW45iMprR3swjstNy+8ZId6gbAFc9E DQgrUYIGEHeJNDTGd/nSbMLPmqnR0gfo8G8/JPyakKTUuYeGK3Wpeh/ecuBc/CS1JP 8Uo1TkL614pTQh3V28kcj46rGtnm4uora0xEg3vNFo96xvIcnMqpRHWM8Q8/Cz0PFZ l9fm6lwWz8svN0UCdhFjmeMgLPTpy/t55OELaMwb/BJPofmy3wIPF+JHoZY2JJqNHR mm9fTvdIEiHtQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Zheyu Ma , Himanshu Madhani , "Martin K . Petersen" , Sasha Levin , njavali@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, jejb@linux.ibm.com, linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 5.14 10/18] scsi: qla2xxx: Return -ENOMEM if kzalloc() fails Date: Mon, 25 Oct 2021 12:59:23 -0400 Message-Id: <20211025165939.1393655-10-sashal@kernel.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211025165939.1393655-1-sashal@kernel.org> References: <20211025165939.1393655-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zheyu Ma [ Upstream commit 06634d5b6e923ed0d4772aba8def5a618f44c7fe ] The driver probing function should return < 0 for failure, otherwise kernel will treat value > 0 as success. Link: https://lore.kernel.org/r/1634522181-31166-1-git-send-email-zheyuma97@gmail.com Reviewed-by: Himanshu Madhani Signed-off-by: Zheyu Ma Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/qla2xxx/qla_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 37ab71b6a8a7..5eed11042f78 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -4071,7 +4071,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len, ql_dbg_pci(ql_dbg_init, ha->pdev, 0xe0ee, "%s: failed alloc dsd\n", __func__); - return 1; + return -ENOMEM; } ha->dif_bundle_kallocs++; -- 2.33.0