Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751850AbdHPFcb (ORCPT ); Wed, 16 Aug 2017 01:32:31 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41980 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751071AbdHPFc3 (ORCPT ); Wed, 16 Aug 2017 01:32:29 -0400 Subject: Re: [PATCH] scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()' To: Christophe JAILLET , manoj@linux.vnet.ibm.com, mrochs@linux.vnet.ibm.com, ukrishn@linux.vnet.ibm.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <20170815201835.781F76A041@b03ledav003.gho.boulder.ibm.com> From: Andrew Donnellan Date: Wed, 16 Aug 2017 15:32:19 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170815201835.781F76A041@b03ledav003.gho.boulder.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-AU Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable x-cbid: 17081605-0048-0000-0000-0000025898DB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17081605-0049-0000-0000-0000480C86E7 Message-Id: <0b3495e0-dd8d-3269-39fe-9f29d751f74b@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-08-16_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1708160092 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 981 Lines: 32 On 16/08/17 06:18, Christophe JAILLET wrote: > 'rc' is known to be 0 at this point. > If 'create_context()' fails, returns -ENOMEM instead of 0 which means > success. > > Signed-off-by: Christophe JAILLET ENOMEM seems right here. Reviewed-by: Andrew Donnellan > --- > drivers/scsi/cxlflash/superpipe.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c > index ad0f9968ccfb..08da593cb2f6 100644 > --- a/drivers/scsi/cxlflash/superpipe.c > +++ b/drivers/scsi/cxlflash/superpipe.c > @@ -1390,6 +1390,7 @@ static int cxlflash_disk_attach(struct scsi_device *sdev, > if (unlikely(!ctxi)) { > dev_err(dev, "%s: Failed to create context ctxid=%d\n", > __func__, ctxid); > + rc = -ENOMEM; > goto err; > } > > -- Andrew Donnellan OzLabs, ADL Canberra andrew.donnellan@au1.ibm.com IBM Australia Limited