Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2334294ybz; Thu, 23 Apr 2020 16:13:35 -0700 (PDT) X-Google-Smtp-Source: APiQypJ+liw+k31L/unMB1iViCR0ya524bPJ3USwL90cllHb+jJ0XFDE5qLbvfUGRdmH/EHMd0Dd X-Received: by 2002:a17:906:1199:: with SMTP id n25mr4969265eja.30.1587683615268; Thu, 23 Apr 2020 16:13:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587683615; cv=none; d=google.com; s=arc-20160816; b=sJpADD4ynXjqJ0rNTwN195LyimAR7u3Wgi88qXJ5JF8WHj/6UvRX23i6gSwn90XTvS QfJjMT7hdf9T9ZWC9XyDzplFh3BFfl0dXbt1IVPphnJuYAw4ZAiGuVE4n119sjVyMfNj R8O+tkVS0agJ77arn3lNWSkgRoq0rFeqnzygi5a/Iy/0QI6wwEp2SkHAbMAkkdEhFDga Me+mm/v9v8O71CydfJmxS78mhzVeYw5KOX/A7xZy6XH0G14dxUkpPAAml4+qxJRkW07Q dMjxi+ByXLviAUGob/PaUz8PVtVg9otVGGJ/Fqej6w5H57BcKKnN4aFBe+9NZhKreIk2 HBIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=aCnx13kcJ+LufDD35v5xlu8FQ7nlpGAbVNciamHtiKs=; b=Eahwsz7N45CRcgQl9pa1HO613Pn6tyUwP9qqTv/k++fEORyXnAom2ATyuU3pfBPRFW WrEsQfPU72Y7bXleE4XsJWRlgwn2sQ2DcKUTsqkRtB4DV7rBCcw375CvuOF+nJc5GxDj tJmGPFdTPgwkWx1dlsk/zQHGuu76546hsaIOa7AuenHh+/gUxW8RxlkldGuQLkoRjLbG kL1VE3G73eSf+bFsS+gJTwaEtsnELRQjZ4aZLBIhxxeB4G6I4O0lxh36xTnj/HsOhg1t 5B9GALjeWCSwrcP/LQp4Qv9XzN1Axq+tR9y5+32cgvuWvfTuYk8uaTlLzL3Y5d1nPwKt 13xw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z18si1973505edx.121.2020.04.23.16.13.11; Thu, 23 Apr 2020 16:13:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729022AbgDWXIv (ORCPT + 99 others); Thu, 23 Apr 2020 19:08:51 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:50936 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728663AbgDWXG7 (ORCPT ); Thu, 23 Apr 2020 19:06:59 -0400 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1jRkvk-0004xG-Jw; Fri, 24 Apr 2020 00:06:52 +0100 Received: from ben by deadeye with local (Exim 4.93) (envelope-from ) id 1jRkvj-00E73X-S3; Fri, 24 Apr 2020 00:06:51 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, Denis Kirjanov , "Max Kellermann" , "Mauro Carvalho Chehab" Date: Fri, 24 Apr 2020 00:07:46 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 239/245] [media] drivers/media/media-devnode: clear private_data before put_device() In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.83-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Max Kellermann commit bf244f665d76d20312c80524689b32a752888838 upstream. Callbacks invoked from put_device() may free the struct media_devnode pointer, so any cleanup needs to be done before put_device(). Signed-off-by: Max Kellermann Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Ben Hutchings --- drivers/media/media-devnode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/media/media-devnode.c +++ b/drivers/media/media-devnode.c @@ -197,10 +197,11 @@ static int media_release(struct inode *i if (mdev->fops->release) mdev->fops->release(filp); + filp->private_data = NULL; + /* decrease the refcount unconditionally since the release() return value is ignored. */ put_device(&mdev->dev); - filp->private_data = NULL; return 0; }