Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp532800rwb; Thu, 10 Nov 2022 04:22:31 -0800 (PST) X-Google-Smtp-Source: AMsMyM6sdZEREKmZGa3UePJxT9XCl0YvhQXVTtQTEghph+0bTGiY7xoebJpdBpf1KYm8BIMRJVGx X-Received: by 2002:a17:902:ab5d:b0:186:bb2e:85a4 with SMTP id ij29-20020a170902ab5d00b00186bb2e85a4mr64941543plb.135.1668082950747; Thu, 10 Nov 2022 04:22:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668082950; cv=none; d=google.com; s=arc-20160816; b=FEqWFAt2rcoJ1lZVb2AJGrKAY3EJGyQHVi4NaAg8EBrS4NTI+2m0c4RnfZdV2OZd59 5xFdTaHNqpZyQJxjUL4tK61eQ0u2TNLnozBkWJ4TC53rzMzKVu+a2J/Ax58EYl20DDvm ukOscBTVhrPkS2COekCFX9N6/NWI4RZFA5O7Z2ecrlHD3o+zgrXCohy0ADzp7KVgI8SZ CeZUJ2XlrFCL25Y42k3Jug4Pun9ooZvyWdfPgDgfVvIeQnumfuX/rge0DNg7KbDBOZgU O872h8rzrIEwGYa/9AT8xKTHqjfI0lPl8N53lxnhuVKZ+I8aa+jQfC3ErvwEmGF3WkiO TMOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from; bh=ugK/2ewqMSfV0PrUPG8Nb3lowWCDmUSJRxSRnOhYsvY=; b=KwFl7l0Q/r9/ky9zs8O7uASQydiksU4Xkb+N3ECVTFqm4PnjI85FtBW8RhyidM656S +uF0oKBARtWq3fvMTz3GhjzBwgu5NwYh9sp7o4DCKl2YTuq9rbMBhcUTl6U+ia8RHKN2 FcveCcGhPPySR9+Rd9imQqL4uOv+ymqpTeybLxqX5gYqLbr0wDhp0Yh8BI92fXEk7D1y UuNBGs1lKNSuWhqKQHQ1YUytfFuBOIPyDAluZXzvpnhR7iSZPxGy5DZ/vl0UD8QK8jow ElO5JeSU9CRtqGowzn8fBphp8XIkcrd/N9Qi0AOz+idMqnB1QX+86HPpK6GsUEzAtMpP hysQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x6-20020a1709028ec600b001836e51050esi18344248plo.572.2022.11.10.04.22.15; Thu, 10 Nov 2022 04:22:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230347AbiKJLjr (ORCPT + 92 others); Thu, 10 Nov 2022 06:39:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230223AbiKJLjp (ORCPT ); Thu, 10 Nov 2022 06:39:45 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84E2C17E3A; Thu, 10 Nov 2022 03:39:43 -0800 (PST) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4N7KcN120fzHvpl; Thu, 10 Nov 2022 19:39:16 +0800 (CST) Received: from dggpemm500015.china.huawei.com (7.185.36.181) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 10 Nov 2022 19:39:41 +0800 Received: from huawei.com (10.175.103.91) by dggpemm500015.china.huawei.com (7.185.36.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 10 Nov 2022 19:39:41 +0800 From: Wang ShaoBo CC: , , , , Subject: [PATCH] mISDN: fix misuse of put_device() in mISDN_register_device() Date: Thu, 10 Nov 2022 19:38:23 +0800 Message-ID: <20221110113823.167822-1-bobo.shaobowang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500015.china.huawei.com (7.185.36.181) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We should not release reference by put_device() before calling device_initialize(). Fixes: e7d1d4d9ac0d ("mISDN: fix possible memory leak in mISDN_register_device()") Signed-off-by: Wang ShaoBo --- drivers/isdn/mISDN/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/isdn/mISDN/core.c b/drivers/isdn/mISDN/core.c index 7ea0100f218a..90ee56d07a6e 100644 --- a/drivers/isdn/mISDN/core.c +++ b/drivers/isdn/mISDN/core.c @@ -222,7 +222,7 @@ mISDN_register_device(struct mISDNdevice *dev, err = get_free_devid(); if (err < 0) - goto error1; + return err; dev->id = err; device_initialize(&dev->dev); -- 2.25.1