From patchwork Sat Aug 14 10:58:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nil Yi X-Patchwork-Id: 497254 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21568C4338F for ; Sat, 14 Aug 2021 10:58:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E2D8E60F36 for ; Sat, 14 Aug 2021 10:58:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237850AbhHNK65 (ORCPT ); Sat, 14 Aug 2021 06:58:57 -0400 Received: from m12-16.163.com ([220.181.12.16]:58512 "EHLO m12-16.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229919AbhHNK64 (ORCPT ); Sat, 14 Aug 2021 06:58:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:Message-ID:MIME-Version; bh=geV4Y LFYGoxJq/Dmh5var0NpU95VmA1N39ebsj9UzJM=; b=nGbRMpBGWJfnNEiLb8vwx yOGcXJwC9liKs+U6+gXhD+UdOvRrhK6YiQtbGAza806aZOVaKFEhqN95bIZFyPaN jWGTc83m1oqdjZqgtptALmvnnEathSt9fIEHeou+oPdpPJbKUKM7SPAF/gJHSLzM aob8k908aHaxL+4dvMYbro= Received: from nilus-desk (unknown [120.229.1.29]) by smtp12 (Coremail) with SMTP id EMCowAAX+TjOoRdhVyMF7g--.6555S3; Sat, 14 Aug 2021 18:58:23 +0800 (CST) Date: Sat, 14 Aug 2021 18:58:22 +0800 From: Nil Yi To: mchehab@kernel.org, linux-media@vger.kernel.org Subject: [PATCH] media: usb: tm6000:clear the freed pointer Message-ID: <20210814105822.GA67154@nilus-desk> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-CM-TRANSID: EMCowAAX+TjOoRdhVyMF7g--.6555S3 X-Coremail-Antispam: 1Uf129KBjvdXoWrtrWrCrW3WF4fJF1rCF4xtFb_yoW3AFX_Cr ykur4DWryjqrn8Kw1xtwnxZr90kFs7ZFyxZFnxt3yrGF1jkF1Y9rWDZF4xJw1kuFy2yF98 Zr9xKFyrWr12gjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU8vApUUUUUU== X-Originating-IP: [120.229.1.29] X-CM-SenderInfo: 5whu0xxqfqqiywtou0bp/1tbi3xDuEmB0HLnzsgAAsD Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org After free the ir->int_urb, the pointer need to be set to NULL. Signed-off-by: Nil Yi --- drivers/media/usb/tm6000/tm6000-input.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/usb/tm6000/tm6000-input.c b/drivers/media/usb/tm6000/tm6000-input.c index 84602edf3..49acb97ca 100644 --- a/drivers/media/usb/tm6000/tm6000-input.c +++ b/drivers/media/usb/tm6000/tm6000-input.c @@ -346,6 +346,7 @@ static int __tm6000_ir_int_start(struct rc_dev *rc) ir->int_urb->transfer_buffer = kzalloc(size, GFP_ATOMIC); if (!ir->int_urb->transfer_buffer) { usb_free_urb(ir->int_urb); + ir->int_urb = NULL; return err; } dprintk(1, "int interval: %d\n", dev->int_in.endp->desc.bInterval);