Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752715AbcLEWan (ORCPT ); Mon, 5 Dec 2016 17:30:43 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:35472 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751563AbcLEWak (ORCPT ); Mon, 5 Dec 2016 17:30:40 -0500 To: Pan Bian Cc: Jitendra Bhivare , Subbu Seetharaman , Ketan Mukadam , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2 v2] scsi: be2iscsi: set errno on error path From: "Martin K. Petersen" Organization: Oracle Corporation References: <1480922623-19261-1-git-send-email-bianpan2016@163.com> Date: Mon, 05 Dec 2016 17:29:30 -0500 In-Reply-To: <1480922623-19261-1-git-send-email-bianpan2016@163.com> (Pan Bian's message of "Mon, 5 Dec 2016 15:23:43 +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: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 627 Lines: 15 >>>>> "Pan" == Pan Bian writes: Pan> Variable ret is reset in the loop, and its value will be 0 during Pan> the after repeat of the loop. Then, if pci_alloc_consistent() Pan> returns NULL, the return value is 0. 0 means no error, which may Pan> make it impossible for the callers of beiscsi_create_cqs() to Pan> detect the memory allocation error. This patch fixes the bug, Pan> assigning "-ENOMEM" to ret on the path that the call to Pan> pci_alloc_consistent() fails. What are the differences between v1 and v2 for these patches? I see no changelog... -- Martin K. Petersen Oracle Linux Engineering