Message ID | 20200810151813.569776422@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <SRS0=uOiG=BU=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=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 50347C433E1 for <stable@archiver.kernel.org>; Mon, 10 Aug 2020 15:41:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 304542080C for <stable@archiver.kernel.org>; Mon, 10 Aug 2020 15:41:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597074085; bh=AGOMaizvFy9TjsAgvMYtf9C1QGamiHd6Zvyz19yNHMY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KhspEX862XpBXz2W/LlFvO7hBj7o+c7IAJRnAJddfU9HhuGaCOvQCeVaUae+vyIjO Jfc+oq0CiFIUpAuigshdqAM6r6DCgKH9zHQ6H0xL5LkKTpURJZIIgn/algo9wYrSs5 vlaf2ftsJyK18mR02VvtcOK+MMAkoGJ6ycKZjyTw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726486AbgHJPXK (ORCPT <rfc822;stable@archiver.kernel.org>); Mon, 10 Aug 2020 11:23:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:54186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728295AbgHJPXI (ORCPT <rfc822;stable@vger.kernel.org>); Mon, 10 Aug 2020 11:23:08 -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 5EA4420772; Mon, 10 Aug 2020 15:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597072988; bh=AGOMaizvFy9TjsAgvMYtf9C1QGamiHd6Zvyz19yNHMY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jVxUDHETFYsGmgRKPqwtV4Dj6oeUKxHfhrQSQfHUn842gvTOb8iakG+kt2lnfOGud XVS4Vpt9OojDAcvQ9vy5DmzBV2rKBJLapI+ioG0DRjCrpscLAWDiEGjFEaBzkJhhus xRLqbjE2g9mQDO0cahE63YgoQE9rvDy2TgvZ1+OM= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Amitoj Kaur Chawla <amitoj1606@gmail.com>, Johan Hovold <johan@kernel.org>, Pavel Machek <pavel@ucw.cz> Subject: [PATCH 5.7 27/79] leds: da903x: fix use-after-free on unbind Date: Mon, 10 Aug 2020 17:20:46 +0200 Message-Id: <20200810151813.569776422@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200810151812.114485777@linuxfoundation.org> References: <20200810151812.114485777@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
|
--- a/drivers/leds/leds-da903x.c +++ b/drivers/leds/leds-da903x.c @@ -110,12 +110,23 @@ static int da903x_led_probe(struct platf led->flags = pdata->flags; led->master = pdev->dev.parent; - ret = devm_led_classdev_register(led->master, &led->cdev); + ret = led_classdev_register(led->master, &led->cdev); if (ret) { dev_err(&pdev->dev, "failed to register LED %d\n", id); return ret; } + platform_set_drvdata(pdev, led); + + return 0; +} + +static int da903x_led_remove(struct platform_device *pdev) +{ + struct da903x_led *led = platform_get_drvdata(pdev); + + led_classdev_unregister(&led->cdev); + return 0; } @@ -124,6 +135,7 @@ static struct platform_driver da903x_led .name = "da903x-led", }, .probe = da903x_led_probe, + .remove = da903x_led_remove, }; module_platform_driver(da903x_led_driver);