Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751244AbcLDKd6 (ORCPT ); Sun, 4 Dec 2016 05:33:58 -0500 Received: from m50-132.163.com ([123.125.50.132]:52413 "EHLO m50-132.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750774AbcLDKd4 (ORCPT ); Sun, 4 Dec 2016 05:33:56 -0500 From: Pan Bian To: Sergei Shtylyov , Karsten Keil , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Pan Bian Subject: [PATCH 1/1] isdn: hisax: set error code on failure Date: Sun, 4 Dec 2016 18:33:23 +0800 Message-Id: <1480847603-15520-1-git-send-email-bianpan201603@163.com> X-Mailer: git-send-email 1.9.1 X-CM-TRANSID: DNGowABXUsjy8ENYcp3JIQ--.19204S3 X-Coremail-Antispam: 1Uf129KBjvdXoWrurWfCr1rGr18Xw4UCrykXwb_yoWfWFc_ua yUWr97Wrs09rn5GF4UKrySvr93Ka1DJF9avw13KasIk34UAw17Cr1q9Fs7Zr18W397tayU Grn5WFy8AF17WjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUYm9aDUUUUU== X-Originating-IP: [114.243.30.33] X-CM-SenderInfo: held01tdqsiiqwqtqiywtou0bp/xtbBXhU291aDoyP3zQAAsl Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 874 Lines: 29 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 "-EBUSY" 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 = -EBUSY; goto out; } -- 1.9.1