Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp767806ybt; Wed, 17 Jun 2020 13:30:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzg3l4ALVIYDcpZFqGGUOkPyY8L9UbwR37ArzdKVq1DfuLgr6VMl89ldqq87lvZ92gJsUY X-Received: by 2002:a17:907:1118:: with SMTP id qu24mr839821ejb.287.1592425805326; Wed, 17 Jun 2020 13:30:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592425805; cv=none; d=google.com; s=arc-20160816; b=lLka3Kjadhf/sHuPcv7HiUdTRIWJ8YVWc7LNsHsEzb9QwMR9t58mkK6HT/Vx+QTenK TNv5bW1t3qk/hXFfwfF8I5FvZg2YmotUVS8hGuw13PJjjHQDDXQib3SzHri5K/FOWnNK eX46PDjMXlhtBgBy5hCgTItTGoM/qB6yyTpPdE9PSLcU5STObUIaKMpN4p1t0MKvFBBa 40Gp+aAes9exy+IbAtDUkGpLrDYSr7iubtWyRX+P+Qkg1pDr5wlD1vxmOOT7/2ZMm1kN AnLq+9dh9/k4yGf+d7OGj9N27uL8nhy1Vc+l2lG3nMYtpns18zL3Mkh4MxSkWM/BTX/U LOkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ZlanElTx2y7cgOrD8V4pxf+aZ9oeERb7sFsONfialCg=; b=Dga/7rkGFRHS/7D6vUYtwS5TPXri8T571TihniaRlijB8VQfuVezqGPvPnGSpN+CnG pgqOjmVu/J2X7o7hDnjz4M97+bSfe+thIwfSHyIhUQwYPE2bvYBGQdNJG4vdVEjDNoQJ oGiIpzyIGLAzbcbpZbw3//VxG4ZItXMKDpoLtcY48lQwVw5gVJO17DZOOesBvPuOFoeJ DKEnuvDwAJk0z0uQQPDdesG12Va/5f2TSdrXF/mBEGRHnVbvZob5FvIQIH2u4+4JhVFm PbYzjPPzGuZvpUMELhpXSnT1jigXBIxgAKQJXIdtGiXemTLgGmClspbkWqWrnaq9ieX3 tlGg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j8si661178edp.99.2020.06.17.13.29.42; Wed, 17 Jun 2020 13:30:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726883AbgFQU17 (ORCPT + 99 others); Wed, 17 Jun 2020 16:27:59 -0400 Received: from smtp04.smtpout.orange.fr ([80.12.242.126]:36975 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726835AbgFQU16 (ORCPT ); Wed, 17 Jun 2020 16:27:58 -0400 Received: from [192.168.42.210] ([93.23.15.97]) by mwinf5d07 with ME id sLTv2200325enVZ03LTvKh; Wed, 17 Jun 2020 22:27:56 +0200 X-ME-Helo: [192.168.42.210] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 17 Jun 2020 22:27:56 +0200 X-ME-IP: 93.23.15.97 Subject: Re: [PATCH] pcmcia/electra_cf: Fix some return values in 'electra_cf_probe()' in case of error To: Olof Johansson Cc: Dominik Brodowski , Andrew Morton , Peter Zijlstra , Christoph Hellwig , Linux Kernel Mailing List , kernel-janitors@vger.kernel.org References: <20200617195326.732863-1-christophe.jaillet@wanadoo.fr> From: Christophe JAILLET Message-ID: <295b82c9-510d-262c-8b88-206372d839ed@wanadoo.fr> Date: Wed, 17 Jun 2020 22:27:55 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 17/06/2020 à 22:10, Olof Johansson a écrit : > On Wed, Jun 17, 2020 at 12:54 PM Christophe JAILLET > wrote: >> 'status' is known to be 0 at this point. It must be set to a meaningful >> value in order to return an error code if one of the 'of_get_property()' >> call fails. >> >> Return -EINVAL in such a case. >> >> Fixes: 2b571a066a2f("pcmcia: CompactFlash driver for PA Semi Electra boards") >> Signed-off-by: Christophe JAILLET >> --- >> drivers/pcmcia/electra_cf.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/drivers/pcmcia/electra_cf.c b/drivers/pcmcia/electra_cf.c >> index 35158cfd9c1a..40a5cffe24a4 100644 >> --- a/drivers/pcmcia/electra_cf.c >> +++ b/drivers/pcmcia/electra_cf.c >> @@ -229,6 +229,8 @@ static int electra_cf_probe(struct platform_device *ofdev) >> >> cf->socket.pci_irq = cf->irq; >> >> + status = -EINVAL; >> + >> prop = of_get_property(np, "card-detect-gpio", NULL); >> if (!prop) >> goto fail1; > The pcmcia_register_socket() call site sets status explicitly before > jumping to fail1, which is a bit clearer. Agreed, but as as you say below, this is not the most active driver in the kernel and PCMCIA, well, does anyone still uses it? > Still, this is a legacy driver, I'm not sure there are any active > users of it these days, and surely nobody that's tinkering around and > editing the device tree (it comes from CFE on these systems, not from > a .dts in the kernel tree). The fix isn't invalid, but it's also not > likely to be an issue in the real world. So, let's just say: In fact this patch has been in my tree for years, because the driver is mostly untouched and certainly used by no one, nowadays. However, 2 weeks ago, commit b274014c6d19 made me think of a revived interest. So I decided to post the patch, just in case. > Acked-by: Olof Johansson > > > -Olof >