Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5736537pxb; Sun, 7 Nov 2021 19:09:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiCNZmmGJIVZvMVdHrVGBbNgOZUM1eSJNxXo3dFRSZPj0g53JcJQw9qbr/pEFmfNiXfsJr X-Received: by 2002:a17:907:2d11:: with SMTP id gs17mr61845071ejc.100.1636340971232; Sun, 07 Nov 2021 19:09:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636340971; cv=none; d=google.com; s=arc-20160816; b=sNI2rO8K/i9fUOmJjfiOlJsjinFr76Lt4rVcfk0/Oi+fX1Pfzl8ydmnJEZdgpOqFUZ IShHoSJM3hww6Qet89ELsxTpyJxZDbI9Sn7fpIG4tr08ShlYztvkkgU0WFmGqjSlvBYT lOq+rfBU9CuNWIa0GnyfzMhXoGJ2sfs41hvS5DqxaGmKs45WMsRkoqSFJJ8ffzE7FLUU Y4OlPhrRnch789CLvCcJDjBms4Iwtop0xlJWO+uw8CPujcMqrJrQR1I/jQrjaEQH4oVP 1kiRfOqGll2b9UtS1oXnFS0++TOJXmWCbKPdXQtVQ1h96/J4HWYA+GA0gN3397XCoglV +m2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=XxklqbtIkT+/FlZAloK9zmxCvIGCyV4XGUspO1KyZhw=; b=0zmX4rdRQc1toOpVroQOihHn0gQMWpmroPM6pBuG3+lPHg1QokdsFWd4zdnwK8SASf 4bp38Dyk6hvv80aXR+woFoTAx712YUSDMBPmuKpfjyvQLOGtGLeMFbJged5qIitaP60a 4BGqSpayH/7Posdu+zCsKfTMYxmNel9g/QE4cr9B/aylgmq1IoUZKwZEb0iRfEpXrc9i ce5giSf/GLvNh856EkQlwu6TnX1cGtLG0nluKVNTy2Enium/oDNR5MBohIwQFcPZ1kmn npkgkLAOg+OWKL6ulA+6fSK9r5b2dBg6goa3cbb+D9EffCx429DDvtwu+u3MLDZhZU99 5n+g== 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 r5si23834323edb.130.2021.11.07.19.08.58; Sun, 07 Nov 2021 19:09:31 -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; 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 S234197AbhKGT76 (ORCPT + 99 others); Sun, 7 Nov 2021 14:59:58 -0500 Received: from smtp03.smtpout.orange.fr ([80.12.242.125]:63421 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234124AbhKGT7z (ORCPT ); Sun, 7 Nov 2021 14:59:55 -0500 Received: from pop-os.home ([86.243.171.122]) by smtp.orange.fr with ESMTPA id joHtmnpvfIEdljoHtmSmvS; Sun, 07 Nov 2021 20:57:11 +0100 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sun, 07 Nov 2021 20:57:11 +0100 X-ME-IP: 86.243.171.122 From: Christophe JAILLET To: 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 Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] platform/x86: hp_accel: Fix an error handling path in 'lis3lv02d_probe()' Date: Sun, 7 Nov 2021 20:57:07 +0100 Message-Id: <5a4f218f8f16d2e3a7906b7ca3654ffa946895f8.1636314074.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) 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); lis3lv02d_joystick_disable(&lis3_dev); lis3lv02d_poweroff(&lis3_dev); flush_work(&hpled_led.work); + lis3lv02d_remove_fs(&lis3_dev); return ret; } -- 2.30.2