Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2778848yba; Mon, 22 Apr 2019 12:48:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVy5bBNMTklJOyaYUYLFDLd9XUv+ePD/gFYXQTMEhUji8Grh1UfdF8oxe9PBYJYcrSrYqq X-Received: by 2002:a62:6444:: with SMTP id y65mr22639247pfb.56.1555962526967; Mon, 22 Apr 2019 12:48:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555962526; cv=none; d=google.com; s=arc-20160816; b=LkTREI+AfghWhTVk/MQ5GI1pW5+Qa1Ca3psNpeKvQTBB6eEQZBGwznsZjygAGDJ3B5 srEXkbdsA5ZEAU0RSeJ9xV61S02g4ApTXIA9j80G/5ihNPSVNjd9wgcEBTeh/yV35Mgp GGaXmAy010OFU6yOLVtCr8Bo0A8OYzAe+jZY5gFXt1rDf+hZTwbt5DF6GMPaM6rzfDIf r6KSAR0kQh+5qfp7AqBWpbSZZCy+T//LyWHbsHWH2ibIXSMO8zurq/NWEj+mG17ZBn8A Jz1wMENVyd4f6HIzEVQn7BA6RyaEDIjKIpTJYI8oSOYjl4QRVmIvCtVgFP5D9YefUelk 2Rig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=u6bm3/fmSEc6OglHOiNtNitw8P2Gzw5jpANJ13Hbgro=; b=nBaD6X0fNu/sz+L6DY5MdCrd8iFFj2at9xw0PO/4+25plNlyK4y7tehTZ7Bbj3EDNJ PVJTMRiGKedlcwbJjA6hF1oAr6plYE7kWscKiB+q5u87WCtoLU2DmwHaCLCCgshiptY/ HS80gjntNlxg5clo1A5si/kMfJ24wAAZi74/lVNUxTTB2XCsx/ee/XywnKPPs8u6s+26 Fi+8HY/4MRxIwxIkDHRVQpYFqxLfim68mviuoowX+z4JMPHZ5CtNUqukqjrB8lrrvyLd tmNGHkxm5XF95Y2BYC0N2VRjTxfmgYXbC45BiXfodqzehn0mHOGgObLsi5rcQehmXqJ1 ZwHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MzDN3AWm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si14686038plw.390.2019.04.22.12.48.30; Mon, 22 Apr 2019 12:48:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MzDN3AWm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730176AbfDVTrI (ORCPT + 99 others); Mon, 22 Apr 2019 15:47:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:49736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729682AbfDVTrG (ORCPT ); Mon, 22 Apr 2019 15:47:06 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 39AF721908; Mon, 22 Apr 2019 19:47:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555962425; bh=okBKAVgy5/JgWzgyhzkFghh0wqimS1gM5WiB6aBHrIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MzDN3AWm+qo3JstQ38BmtziSbZInzvj7wNz3NyBUC9vcDZJn9+/HywJeTVmjFQ6QW +g/Ul1ox38xjcgvjwOjAD+ldgFsIzo1CR9XzyB+TX8xaInha4aNnWpvAZR6Ce2cBJX gBYET+LVggJ0DGMTZ+ppmYRYVVjn9tjjqJLtMfj4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mukesh Ojha , Greg Kroah-Hartman , Sasha Levin , linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 55/68] usb: u132-hcd: fix resource leak Date: Mon, 22 Apr 2019 15:45:03 -0400 Message-Id: <20190422194516.11634-55-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190422194516.11634-1-sashal@kernel.org> References: <20190422194516.11634-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mukesh Ojha [ Upstream commit f276e002793cdb820862e8ea8f76769d56bba575 ] if platform_driver_register fails, cleanup the allocated resource gracefully. Signed-off-by: Mukesh Ojha Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin (Microsoft) --- drivers/usb/host/u132-hcd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c index 5b8a3d9530c4..5cac83aaeac3 100644 --- a/drivers/usb/host/u132-hcd.c +++ b/drivers/usb/host/u132-hcd.c @@ -3202,6 +3202,9 @@ static int __init u132_hcd_init(void) printk(KERN_INFO "driver %s\n", hcd_name); workqueue = create_singlethread_workqueue("u132"); retval = platform_driver_register(&u132_platform_driver); + if (retval) + destroy_workqueue(workqueue); + return retval; } -- 2.19.1