Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751169AbcLDKOY (ORCPT ); Sun, 4 Dec 2016 05:14:24 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:35969 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750774AbcLDKOX (ORCPT ); Sun, 4 Dec 2016 05:14:23 -0500 Subject: Re: [PATCH 1/1] isdn: hisax: set error code on failure To: Pan Bian , Karsten Keil , netdev@vger.kernel.org References: <1480828511-4251-1-git-send-email-bianpan201603@163.com> Cc: linux-kernel@vger.kernel.org, Pan Bian From: Sergei Shtylyov Message-ID: Date: Sun, 4 Dec 2016 13:14:18 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1480828511-4251-1-git-send-email-bianpan201603@163.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 996 Lines: 33 Hello. On 12/4/2016 8:15 AM, Pan Bian wrote: > From: Pan Bian > > In function hfc4s8s_probe(), the value of return variable err should be > negative on failures. However, when the call to request_region() returns > NULL, the value of err is 0. This patch fixes the bug, assiging > "-ENOMEM" to err on the path that request_region() fails. > > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188931 > > Signed-off-by: Pan Bian > --- > drivers/isdn/hisax/hfc4s8s_l1.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c > index 9600cd7..3172cee 100644 > --- a/drivers/isdn/hisax/hfc4s8s_l1.c > +++ b/drivers/isdn/hisax/hfc4s8s_l1.c > @@ -1499,6 +1499,7 @@ struct hfc4s8s_l1 { > printk(KERN_INFO > "HFC-4S/8S: failed to request address space at 0x%04x\n", > hw->iobase); > + err = -ENOMEM; -EBUSY fits request_region() better. [..] MBR, Sergei