Message ID | 20200526183914.507467866@linuxfoundation.org |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=+fRt=7I=vger.kernel.org=stable-owner@kernel.org> 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 68949C433DF for <stable@archiver.kernel.org>; Tue, 26 May 2020 18:55:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A88D208B3 for <stable@archiver.kernel.org>; Tue, 26 May 2020 18:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590519323; bh=dVy0LRePgbkEtZhtYdBgh1mFB0WuQl4IXpOliByWPYE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rMvH8nI5Y+hT2PSh3JcMy5hrv6c1dI5ne18aJRxYkbSKMmt/47rxv4Hr3r0Zavrwk irmuLF/NKiYT7nUHMsIPfRQYYqI1lv2ozFzFVqY7ycxL95lYfXvZl3J4pdKkT8UR0p m42I7K3N0y+blnwGMhXknNHhEB6K1jFhGykdReTc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389455AbgEZSzW (ORCPT <rfc822;stable@archiver.kernel.org>); Tue, 26 May 2020 14:55:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:47710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389451AbgEZSzU (ORCPT <rfc822;stable@vger.kernel.org>); Tue, 26 May 2020 14:55:20 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DE341208C3; Tue, 26 May 2020 18:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590519320; bh=dVy0LRePgbkEtZhtYdBgh1mFB0WuQl4IXpOliByWPYE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TPEp2+GsV24bx5CrEsTDFbkJh+hMWynfxGUb+hum8P/l80t9FD2IjTdpWFUkwFNre ZEytKS15IfFV29arns3pgYpd4xs9EZsqTeFyXNRFDIgv6+E1DZ2f1HZZR7RReFbEA6 b617oGhBKRii6s1//+JHCCw9aOajSMoonRh38YVo= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Dan Carpenter <dan.carpenter@oracle.com>, Wolfram Sang <wsa@the-dreams.de>, Ben Hutchings <ben.hutchings@codethink.co.uk>, Sasha Levin <sashal@kernel.org> Subject: [PATCH 4.4 22/65] i2c: dev: use after free in detach Date: Tue, 26 May 2020 20:52:41 +0200 Message-Id: <20200526183914.507467866@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526183905.988782958@linuxfoundation.org> References: <20200526183905.988782958@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index 382c66d5a470..e5cd307ebfc9 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c @@ -599,9 +599,9 @@ static int i2cdev_detach_adapter(struct device *dev, void *dummy) if (!i2c_dev) /* attach_adapter must have failed */ return 0; + cdev_del(&i2c_dev->cdev); put_i2c_dev(i2c_dev); device_destroy(i2c_dev_class, MKDEV(I2C_MAJOR, adap->nr)); - cdev_del(&i2c_dev->cdev); pr_debug("i2c-dev: adapter [%s] unregistered\n", adap->name); return 0;