Message ID | 20230427133350.31064-5-oneukum@suse.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp273018vqo; Thu, 27 Apr 2023 06:35:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6cqDNLUQx+JrUqTZsVdluoQm1UWUNiV1y/oY7bQdXzVsjxtQwHUl5CmAX7Bsri2MtnKO9r X-Received: by 2002:a05:6a21:3294:b0:f2:6fc6:9ca3 with SMTP id yt20-20020a056a21329400b000f26fc69ca3mr2037448pzb.43.1682602552701; Thu, 27 Apr 2023 06:35:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682602552; cv=none; d=google.com; s=arc-20160816; b=BdMcS1IN5IG4BexZevh2N1JdNHsTTtQ/AnxcCAqp3WvwvvNKWgkxU19kjTiHRVmbU9 8Vm6muwNk9HXRo73Vm+Rbo0KBKsGxlTjPv3h45CbZi5q/ogpZFWIV+ihS0rvkSCrR4PT cFN1Jw9dTnMbQy7uu5ZJTAb+Eo4NOFlH4vA2A6tBQIINUu3cPRheW3xZvr//Q+lZF1zC VuDDgVf8e6llpZjRFABDz+LbmDrX8U0iw7t4jKl2I2nMRxi316xSAZ425bLwjXFpKTNO cwny7j0a5Ws7Lz/rQNT7XuFO8ZRBi327AtAatghZyoX+aXnyMTXKEWeU+7QhC8Yyr4pe vObg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=66U18+mtQGCyxXC0M1Viz0RN7ENmrIwJoeJCXyBN1ds=; b=VOceFqfgQCggtlf/iXw8qgMCwiaqPLtyOmuQvnwfCNBzCFfJAm/xh0MUz5ceJFU3t2 PbeLIhIMukgWNzI/xZ1uUDLJYm1vdimeCKH1goftx68Um1NezO0gvRA29XuSOwNEyJVV kgQBBdJy8r7SuXl+t8xnp33l3OLPz/kfV3eSvAOIJl3J6Tope2RtjvnCblGUJVSlgS7S +msoKdQdxkrJvB87dmtLxoZLB3RcGLcCHHPdTt1ayyyTa/Otm/vz/b4huZcxBXRd0Y3Y CUemORegfOgRglIYJfvnU8bcK8r0whjfVbpVl7LBePEWvw5MTpbK9C8IaXEC19wA1KLP v9Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=NmejHtbi; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f35-20020a631f23000000b00513cdc43ecfsi18677318pgf.332.2023.04.27.06.35.39; Thu, 27 Apr 2023 06:35:52 -0700 (PDT) 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; dkim=pass header.i=@suse.com header.s=susede1 header.b=NmejHtbi; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243767AbjD0NeH (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); Thu, 27 Apr 2023 09:34:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243615AbjD0Nd5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 27 Apr 2023 09:33:57 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52F731B8; Thu, 27 Apr 2023 06:33:56 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0099A1FE31; Thu, 27 Apr 2023 13:33:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1682602435; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=66U18+mtQGCyxXC0M1Viz0RN7ENmrIwJoeJCXyBN1ds=; b=NmejHtbin+lt361qaGQBDureWP0SETBpWpDhTqTc9Y3QRGtPbcvm1Jio13dAjE+KK0DAUQ 0KjV/tLxF5PFRj0jORn7gPVcZALgcLmGAa3SiZ9G6aTu0oxh97D7muMS8eFdDGGoGhFCHw ZE4eKXOKjF9E5RBgjD/xj5p8qbt/uT0= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id ABCC2138F9; Thu, 27 Apr 2023 13:33:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8EkMKMJ5SmSVeQAAMHmgww (envelope-from <oneukum@suse.com>); Thu, 27 Apr 2023 13:33:54 +0000 From: Oliver Neukum <oneukum@suse.com> To: wim@linux-watchdog.org, linux@roeck-us.net, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Oliver Neukum <oneukum@suse.com> Subject: [PATCH 4/8] pcwd_usb: do not leave a freed URB active Date: Thu, 27 Apr 2023 15:33:46 +0200 Message-Id: <20230427133350.31064-5-oneukum@suse.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230427133350.31064-1-oneukum@suse.com> References: <20230427133350.31064-1-oneukum@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764336653918901931?= X-GMAIL-MSGID: =?utf-8?q?1764336653918901931?= |
Series |
[1/8] pwcd_usb: fix error handling in probe
|
|
Commit Message
Oliver Neukum
April 27, 2023, 1:33 p.m. UTC
Fix disconnect so that the URB is killed.
Not doing so leaves this to error handling
in the case of physical disconnect.
This fixes the case of a soft disconnect
and prevents multiple accesses to freed
memory.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
drivers/watchdog/pcwd_usb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c index ed3be8926a15..fe58ec84ce8c 100644 --- a/drivers/watchdog/pcwd_usb.c +++ b/drivers/watchdog/pcwd_usb.c @@ -815,6 +815,7 @@ static void usb_pcwd_disconnect(struct usb_interface *interface) /* We should now stop communicating with the USB PCWD device */ usb_pcwd->exists = 0; + usb_kill_urb(usb_pcwd->intr_urb); /* Deregister */ misc_deregister(&usb_pcwd_miscdev);