Received: by 10.192.165.148 with SMTP id m20csp2543937imm; Sun, 22 Apr 2018 09:14:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx49QnpXurXUW2Ot6clTyOT7oAI+/QxoJGk0IyDd0XeXGoGrfidSgQTOJzlHRQIydbGW6nDKh X-Received: by 2002:a17:902:6542:: with SMTP id d2-v6mr7690722pln.196.1524413642170; Sun, 22 Apr 2018 09:14:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524413642; cv=none; d=google.com; s=arc-20160816; b=RSm0SzXzbFkL1X1c1SCaKvInNO3A/57fWwoIscvQBUyT6GDWL41Gdd+jrEJ8k/a+5w 3I3mpN5dS3caaUycwgpcrVnljuxUDn5hrruydjNYHUKxUCYUg7NVUasZYtOv6o+hgpee sJXaEKmFG7whbq/H9hdFNAI7x0PzYP0rM1eNhliAmW/eKNpP5ke+A6HWrUctilejD+mC 25KV/KUvHFLjHldgihcVLk5M25xC2RXStGcuJumEEdCRdPMQ4uT4JgHmrbKvHvQNDx1C rdqEHsT0dSzGjPMthFqUZI5BKkIviiCE4NXOWrXZ3Kspc6aWBLV5v35w/Yodt+zlMKRD njgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=PgoeZu5KTFaLkfuw99stq/5vwoK9D6ixjdSkQkq2H5k=; b=XqJchxZVBu379rYRc/MHmv+zRnT1j6Vynad9yVNDMobz6pphbtrhIVqkMU4MvJC0RG EtqbOzeYW3QeCrIiHE9rS86jiJ4dzjzOrcbxAIUAYroNnErj79fc174Ben0fLAaBJz3w 2xdJtWLaIsLpzNRVKXhlDHtOY/vtKu3HzXplFM5eqmtVGfn0xNczoPBE0GcBDtjBym/8 /5AdjQ/i+JX3wasGaqp1Tq3NDGgCr44+cwvYFwi54rr4XWpkpRdfjmUZZaorHs0erT++ tghlToSWJZzfGDZbcmEWf16ucUIZVu3fTssg85syhTi+iNMtdtSapNY29L9PedyS39FS V7bg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l5-v6si4399281pli.409.2018.04.22.09.13.48; Sun, 22 Apr 2018 09:14:02 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753884AbeDVQMq (ORCPT + 99 others); Sun, 22 Apr 2018 12:12:46 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44752 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753441AbeDVNzk (ORCPT ); Sun, 22 Apr 2018 09:55:40 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9AD3D8FF; Sun, 22 Apr 2018 13:55:39 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Young , Mauro Carvalho Chehab Subject: [PATCH 4.16 030/196] media: rc: oops in ir_timer_keyup after device unplug Date: Sun, 22 Apr 2018 15:50:50 +0200 Message-Id: <20180422135105.663230626@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sean Young commit 8d4068810d9926250dd2435719a080b889eb44c3 upstream. If there is IR in the raw kfifo when ir_raw_event_unregister() is called, then kthread_stop() causes ir_raw_event_thread to be scheduled, decode some scancodes and re-arm timer_keyup. The timer_keyup then fires when the rc device is long gone. Cc: stable@vger.kernel.org Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/rc/rc-main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -1929,12 +1929,12 @@ void rc_unregister_device(struct rc_dev if (!dev) return; - del_timer_sync(&dev->timer_keyup); - del_timer_sync(&dev->timer_repeat); - if (dev->driver_type == RC_DRIVER_IR_RAW) ir_raw_event_unregister(dev); + del_timer_sync(&dev->timer_keyup); + del_timer_sync(&dev->timer_repeat); + rc_free_rx_device(dev); mutex_lock(&dev->lock);