Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3535644pxp; Tue, 8 Mar 2022 16:52:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIkCwQjPJPUmnhOHkgGIdfsfDR7e/e2qsHRf6kcTQZ9XJPGDspJMrVOfm84C4hsHucsV72 X-Received: by 2002:a17:90b:4f8e:b0:1bf:8b95:da05 with SMTP id qe14-20020a17090b4f8e00b001bf8b95da05mr6300477pjb.216.1646787178927; Tue, 08 Mar 2022 16:52:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646787178; cv=none; d=google.com; s=arc-20160816; b=wvvqd3sOj1ESqjAZ8ynMYuvFBBAiiY5ZhjVVDliXawbpKdwpqDmbXY6xw9ee0bfGjX H3U4tmjBM42d9/D/V8NwBQIbgcvXlHniWgx9X2QfZorpHcCsI4ix5oelWzuXteyAEwvb nsfibKt/4JN41LzQD6kcWtvEpCT4M7CU5lZRkh7eo24BUwfNqS70HafayfrbNuXnJQEm e2EPRc7tNz68o9x1K8OZz0xxsy+qatnmWReESeqd8UDxqxKNS8w9rV41cgQosdMc9OLs h/SnNc611zKFXa+9Y+5rVqi9SlMBsvLdIbmNG/xApMPIgBK5stGqVpa2034A2RmaetL6 6kEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=rFaXmSp0CUO3MUoxtONyEeHswEbCY1B/ujO2ak9ia2U=; b=rLP3hg2m1qNElXOZHYhcXjN21JgSTLPyVUuRJ+SAD9rWHdHpjDq/ZCicrd1c04SuQ6 aGt55DFxGj/Ijytr3VvxvDUy+Ahpkk5R1mwh0q2y47zA+FrxsfPODQ0sdyCG1BTrck/5 5lXJSTwwdx4sEQayT8Q5ZLebuuE/R5lJDimPm/sL2zh9sW9UpO6ndwWMs52YugASag2C +WRspFbzkGwnXNch3WCepFr1Rs2nnf7Mwn4KwtyYOLjcFXyr2bFAwho88g6S2H9Czxis qpY3LA+lk/vNSyZYFAkz+krtT5+N9xyS6hnI3msI76dm3tthjlHOTHZY4FtsB8krDL3c IQ1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iGcIaMfp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z2-20020a63b902000000b003758cfb6291si371149pge.204.2022.03.08.16.52.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 16:52:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iGcIaMfp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 478FDE7AF3; Tue, 8 Mar 2022 16:08:09 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350361AbiCHVOQ (ORCPT + 99 others); Tue, 8 Mar 2022 16:14:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234717AbiCHVOP (ORCPT ); Tue, 8 Mar 2022 16:14:15 -0500 Received: from mail-vs1-xe2d.google.com (mail-vs1-xe2d.google.com [IPv6:2607:f8b0:4864:20::e2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83B7C32EC0; Tue, 8 Mar 2022 13:13:18 -0800 (PST) Received: by mail-vs1-xe2d.google.com with SMTP id a186so184010vsc.3; Tue, 08 Mar 2022 13:13:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rFaXmSp0CUO3MUoxtONyEeHswEbCY1B/ujO2ak9ia2U=; b=iGcIaMfp4FsLPBTkkVEWgveu1ZKeaJGm6BV0qJRw/awR3InWaE/GhJaFZTGMfQ25en 4ts4sXERNYWH61JPQsci41eJBRu7oml141O22s4Cvv5p7P6FK30dA65l1DWFEhHzOnuI FMLIQ8EeYAINY9ieXQsAOUxEbzJxGpf4helFl+EmaAagwzKO8deFyy2z63r9+H9xs0Fa sH9Er91VVabvh8kiweFm58a6Lr2k8JsQC6Eezx5hQwxf0kYykzxYCAXFZHNj+/58FLj3 3JmHBdXja0SU8UCg/AC6lsHzh7+48cRqV3EoQC1C9DDLgJgaE/EGLvPdiQSArdb9MTxh pkXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rFaXmSp0CUO3MUoxtONyEeHswEbCY1B/ujO2ak9ia2U=; b=rntuuNCnQbhzOR+VsLzdmmqw30zQ/4IUbwz2Y/LGHFNHkBTBEFiYjjVW4SDAQhBqo6 UX3+09JvG2WNbViFfItwuZL+ancNzC+t8ny0n7szT/Lz+fnx1IbIrgM7Yj1a2LUKQMSU jgBpeDwevKZG736LACK9M8ykeS+Hka3+/gUFeqwmJbY00xsQztJ0sSP9OTEKrBeaSClp 9ojGOwcfID0vxwoziIy602PZ6JD1Kx+P1Rla2gUw9cOgrM869DWXvwjxGXT29wx/9q0o CPMtVOo31qTvCta0tzApVx8IhFIC2tyni2SmIeRp+t17BlCFSMFD9znAZEmPUPW4t04j No0w== X-Gm-Message-State: AOAM533T+nOcPG9D1ujPmYPXO51WbmRI6L454Z1fWDl/6/jXXNBmu/15 ykDJ4+w7sn6Zg24DfKfqnhrG5py5cdwtSc38l9s= X-Received: by 2002:a05:6102:3f01:b0:320:678d:a18a with SMTP id k1-20020a0561023f0100b00320678da18amr8692190vsv.81.1646773997571; Tue, 08 Mar 2022 13:13:17 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dmitry Torokhov Date: Tue, 8 Mar 2022 13:13:05 -0800 Message-ID: Subject: Re: [PATCH] HID: vivaldi: fix sysfs attributes leak To: Jiri Kosina Cc: Benjamin Tissoires , Stephen Boyd , "Sean O'Brien" , "linux-input@vger.kernel.org" , lkml Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 1, 2022 at 6:31 AM Jiri Kosina wrote: > > On Fri, 25 Feb 2022, Dmitry Torokhov wrote: > > > The driver creates the top row map sysfs attribute in input_configured() > > method; unfortunately we do not have a callback that is executed when HID > > interface is unbound, thus we are leaking these sysfs attributes, for > > example when device is disconnected. > > > > To fix it let's switch to managed version of adding sysfs attributes which > > will ensure that they are destroyed when the driver is unbound. > > > > Fixes: 14c9c014babe ("HID: add vivaldi HID driver") > > Signed-off-by: Dmitry Torokhov > > --- > > > > Compiled only. > > > > drivers/hid/hid-vivaldi.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/hid/hid-vivaldi.c b/drivers/hid/hid-vivaldi.c > > index efa6140915f4..42ceb2058a09 100644 > > --- a/drivers/hid/hid-vivaldi.c > > +++ b/drivers/hid/hid-vivaldi.c > > @@ -144,7 +144,7 @@ static void vivaldi_feature_mapping(struct hid_device *hdev, > > static int vivaldi_input_configured(struct hid_device *hdev, > > struct hid_input *hidinput) > > { > > - return sysfs_create_group(&hdev->dev.kobj, &input_attribute_group); > > + return devm_device_add_group(&hdev->dev, &input_attribute_group); > > } > > > > static const struct hid_device_id vivaldi_table[] = { > > Applied, thanks Dmitry. Jiri, are you planning to send this for 5.17 or 5.18? Thanks. -- Dmitry