From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D55BCCA47E for ; Tue, 7 Jun 2022 19:37:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356283AbiFGTgA (ORCPT ); Tue, 7 Jun 2022 15:36:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353772AbiFGSqF (ORCPT ); Tue, 7 Jun 2022 14:46:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16BA218A85C; Tue, 7 Jun 2022 10:59:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 45B0D61804; Tue, 7 Jun 2022 17:59:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D616C385A5; Tue, 7 Jun 2022 17:59:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654624765; bh=uR7CQe4V55FxsHzDZ0qleDY1nvIx7lIoX7D3hsclkWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B4yYkpAAfZpoZzTNvz86RfYZj9oEFAH7Cbe1zY/6xYUoQK6HghuNv6euGZr6Ol/Sf G/eR7muqOFzyPmvt3DUqZKcVvNhTlPpWvhyEoHeWRZePNoOUANEiUc2ZgbRyQlyAei ikJCneiSNohu7FfIabrbyzWhX+hLtpfPXvIQG1+sBSAJODhesCuS0pjesTfwIGZKCi kmr+tBD23rY3GjPr1e4lzIIhNT0U9hLi/hyE5ZZfUp2Vb8WHnCbF5CTaFgKHpkc5qt v7dAqfXxc8ZvSzIyDEgQwJkeKTNqx0YptpcdpMcVAAEjI/UgDdpW5zh+UBTuCLScnA +7xrtpGrBfZnw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Shuah Khan , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 5.10 15/38] misc: rtsx: set NULL intfdata when probe fails Date: Tue, 7 Jun 2022 13:58:10 -0400 Message-Id: <20220607175835.480735-15-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220607175835.480735-1-sashal@kernel.org> References: <20220607175835.480735-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shuah Khan [ Upstream commit f861d36e021e1ac4a0a2a1f6411d623809975d63 ] rtsx_usb_probe() doesn't call usb_set_intfdata() to null out the interface pointer when probe fails. This leaves a stale pointer. Noticed the missing usb_set_intfdata() while debugging an unrelated invalid DMA mapping problem. Fix it with a call to usb_set_intfdata(..., NULL). Signed-off-by: Shuah Khan Link: https://lore.kernel.org/r/20220429210913.46804-1-skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/misc/cardreader/rtsx_usb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/misc/cardreader/rtsx_usb.c b/drivers/misc/cardreader/rtsx_usb.c index 59eda55d92a3..1ef9b61077c4 100644 --- a/drivers/misc/cardreader/rtsx_usb.c +++ b/drivers/misc/cardreader/rtsx_usb.c @@ -667,6 +667,7 @@ static int rtsx_usb_probe(struct usb_interface *intf, return 0; out_init_fail: + usb_set_intfdata(ucr->pusb_intf, NULL); usb_free_coherent(ucr->pusb_dev, IOBUF_SIZE, ucr->iobuf, ucr->iobuf_dma); return ret; -- 2.35.1