Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp479383pxb; Mon, 8 Nov 2021 17:03:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9NT0n83CCnN7TJNlz0vavIEdW0Uk0xcnikQ2omVxMIB9kGtv5aq6nyBOllWvuhdFrQHia X-Received: by 2002:a17:906:1599:: with SMTP id k25mr4445231ejd.298.1636419782060; Mon, 08 Nov 2021 17:03:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636419782; cv=none; d=google.com; s=arc-20160816; b=oaidPyRdDbB/QzfnL0oNOrrC5hZo6LqccCxATGDYpuHwMk/D2iHSn0gz9eH1IncGBF N771aFBlVRjcn7qr5Fqgn7YWixAHVUjoRZO/nqXN74VjXzRYqdCMaLwx4+bK2KvANotH 2+aOxg0uZRmj69LQzmeM6LyrfpR05qe0r+Zlc+ZCL8iWXHSjHn4W9YTco9j1u/l0cZUU o9ou0IKT0l/FMB0Cz6x3K3hqV3T9ymcGTvMWVY77qr/ZKtGQSA/Q0TMVOcFVnPoPPBNn fck3uzVpADWyyb8T9ZfF0npy7owYOtLVmOohTEb5nKCvZ6E/ZcOyujtklW1Sk0brST6c TU8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mO7v6Cu4M+0R5yO2iqq/1mGqPlyjjsZ2RRi59ExpzDk=; b=yB/EPwvs0ubKNrTpt5vwsVaiBPouNQVFIDEzErsTBwpwxvJTXlQSpKx5xeFkBtMJpc ELqRUDpIccP+8elYv2OPyPZqn8QmXv0gsMaIG7RmWzhqrL9Jy3XZ0IALSYsOJx0QGLtr HU6fLjY7asik9HXFxeC+JWnTk4Co4q6kdfCdb4P9WsITgsL8HuxD4GSZPRKQiD9FlXiP wkgtXZAW3n8ruSk19IFJCHUD6KFfvfA47+cPRnb2SE7v3VV80tK0F0bh3CuV7+s+aCkm /r27UZFUiC3y/ASY/Nrit0xEyHs0LP0rMCdKNKoVNwwvZJQcw1btxxFSJ3jvMK/pwerr LBwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PUAb3ROJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h24si31067456ejt.408.2021.11.08.17.02.33; Mon, 08 Nov 2021 17:03:02 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PUAb3ROJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237809AbhKHTvB (ORCPT + 99 others); Mon, 8 Nov 2021 14:51:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:60190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237645AbhKHTvA (ORCPT ); Mon, 8 Nov 2021 14:51:00 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E68CC61074; Mon, 8 Nov 2021 19:48:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636400896; bh=Xy6ERyO9VjI/NLdRp8FAcG8mXjwDb9dKMByPj5Ztw6M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PUAb3ROJN2WP1Lsvst6dN6twK86GEuXSzzVMztMD5QQsQ4E4B/Y/oK/0H78jEWF1p /9W2kyhfZJ+7pz4bbjeeyOmV4iMN5C9QTmh2gBxIT+k8k3TjvamHrqTP5IDC5fPQqt Vn9RIFxOWnAFM90FNm+Qt+l8TN22x//fHf6tf3D/19DnAJTV2EGJeGv6696SRqmHHd y/C4hAqVUH+skc2LX0x0fhfzL2ON1idw6ctv0hbSIiwGitkCvJWDYQj9KI458TK1El ZmJRX5lPXKgs27NY4fX2IL4HeaPAv4HvIETRgS2M4uGGBmgv7XhOqsRWWNuujuaibv 1tWF8j+Pigsdg== Date: Mon, 8 Nov 2021 11:48:14 -0800 From: Mark Gross To: Christophe JAILLET Cc: eric.piel@tremplin-utc.net, hdegoede@redhat.com, markgross@kernel.org, dmitry.torokhov@gmail.com, giedriuswork@gmail.com, dvhart@linux.intel.com, akpm@linux-foundation.org, pavel@suse.cz, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] platform/x86: hp_accel: Fix an error handling path in 'lis3lv02d_probe()' Message-ID: <20211108194814.GI61200@T470> References: <5a4f218f8f16d2e3a7906b7ca3654ffa946895f8.1636314074.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5a4f218f8f16d2e3a7906b7ca3654ffa946895f8.1636314074.git.christophe.jaillet@wanadoo.fr> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 07, 2021 at 08:57:07PM +0100, Christophe JAILLET wrote: > If 'led_classdev_register()' fails, some additional resources should be > released. > > Add the missing 'i8042_remove_filter()' and 'lis3lv02d_remove_fs()' calls > that are already in the remove function but are missing here. > > Fixes: a4c724d0723b ("platform: hp_accel: add a i8042 filter to remove HPQ6000 data from kb bus stream") > Fixes: 9e0c79782143 ("lis3lv02d: merge with leds hp disk") > Signed-off-by: Christophe JAILLET > --- > drivers/platform/x86/hp_accel.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/platform/x86/hp_accel.c b/drivers/platform/x86/hp_accel.c > index b183967ecfb7..435a91fe2568 100644 > --- a/drivers/platform/x86/hp_accel.c > +++ b/drivers/platform/x86/hp_accel.c > @@ -331,9 +331,11 @@ static int lis3lv02d_probe(struct platform_device *device) adding some lines of context: 326 /* filter to remove HPQ6000 accelerometer data 327 * from keyboard bus stream */ 328 if (strstr(dev_name(&device->dev), "HPQ6000")) 329 i8042_install_filter(hp_accel_i8042_filter); 330 > INIT_WORK(&hpled_led.work, delayed_set_status_worker); > ret = led_classdev_register(NULL, &hpled_led.led_classdev); > if (ret) { > + i8042_remove_filter(hp_accel_i8042_filter); This filter was added under a conditional. Should it not be removed under a similar conditional? > lis3lv02d_joystick_disable(&lis3_dev); > lis3lv02d_poweroff(&lis3_dev); > flush_work(&hpled_led.work); > + lis3lv02d_remove_fs(&lis3_dev); where was the fs ever added? --mark > return ret; > } > > -- > 2.30.2 >