Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752801AbcLEWY6 (ORCPT ); Mon, 5 Dec 2016 17:24:58 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:29394 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751455AbcLEWYy (ORCPT ); Mon, 5 Dec 2016 17:24:54 -0500 To: Pan Bian Cc: Subbu Seetharaman , Ketan Mukadam , Jitendra Bhivare , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Pan Bian Subject: Re: [PATCH 1/2] scsi: be2iscsi: set errno on error path From: "Martin K. Petersen" Organization: Oracle Corporation References: <1480828902-4406-1-git-send-email-bianpan201603@163.com> Date: Mon, 05 Dec 2016 17:24:40 -0500 In-Reply-To: <1480828902-4406-1-git-send-email-bianpan201603@163.com> (Pan Bian's message of "Sun, 4 Dec 2016 13:21:42 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 569 Lines: 13 >>>>> "Pan" == Pan Bian writes: Pan> Variable ret is reset in the loop, and its value will be 0 during Pan> the second and after repeat of the loop. If pci_alloc_consistent() Pan> returns a NULL pointer then, it will leaves with return value 0. 0 Pan> means no error, which is contrary to the fact. This patches fixes Pan> the bug, explicitly assigning "-ENOMEM" to return variable ret on Pan> the path that the call to pci_alloc_consistent() fails. Applied patches 1 and 2 to 4.10/scsi-queue. -- Martin K. Petersen Oracle Linux Engineering