Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4734849iob; Sun, 8 May 2022 23:41:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRJ0umH9fgG23Jl6X1fDM1vyVUEJhY/zNcJ0gON/HCDEw7bvSDn+Fb9EjzRK6YXrL27tp/ X-Received: by 2002:a17:90a:c7d2:b0:1d9:34fe:10dc with SMTP id gf18-20020a17090ac7d200b001d934fe10dcmr24932822pjb.109.1652078488418; Sun, 08 May 2022 23:41:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652078488; cv=none; d=google.com; s=arc-20160816; b=L1PfHH11RLCe9EeRqisjuKNXNGDsb01jHSRpYUHSHBIs7f7adsw+5TAD8p5VnIuk74 Yyfcosnt7Kkw3exq9moGACsEsOiQMV4BpB/Zd4LcIgWgfNAyH86ywZFv49NDk/K6FyUj Kire6fVtX9/vaf8G1z+8KRmATnmvYglnjSJ0MWBzW17Fdyyd6OZ6VT5wSKIkRt1zkit6 mh0wXmvTfBVj0F+wGOEtcrzaSvU9fsdBJQkrE/dFGEdbqFT2DoAvked5ym1qlpGPIETN MlICfbeqxOYSgriQVdtL/fGvGonaZRIwHg4Kg95/4MLfxiCnIXvv6JPTF5tK8cjQwQ5r mkkA== 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=48nMT+gnh1vkPS6WcET22AquP1bwix2Jf1ru/W7jPF0=; b=wNuVzQu5I2JDvpFiWaczfazLGoa00CVmuodi3gaT7jDGhC9q/EXfg75rQKEFFHlRRP IH3EF9NvnvtVM46Sx46nFyDQhfRvA/MJW7Jx74lAI4FKJkjpdSM6N8/zI9MJQzvFI3jo ZfnYUcajP0stncLlXPIMERImeAua5K73c/frYyhXc7mjKf/Xiq8UE4G1IaiDooJ3R4a3 vjOCMQ90LmYF1n86kOD1y1C2SzABNy/JHvPGVkDD87Q3rGI2FQwEfLHkES+USMNDnxnJ cHb3Z5K+/y/GKlVQ+ubnYp9eVQUSFiW+m3rOBsyXb0V0tR2JZk80NSPDQjkHqu/bYwYa wbzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IbrYmItb; 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 t20-20020a170902b21400b00153ce7c9244si10395401plr.97.2022.05.08.23.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 23:41:28 -0700 (PDT) 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=IbrYmItb; 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 CEAB318E3FD; Sun, 8 May 2022 23:38:43 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390017AbiEFIRv (ORCPT + 99 others); Fri, 6 May 2022 04:17:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1390020AbiEFIRb (ORCPT ); Fri, 6 May 2022 04:17:31 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDCE2689A8 for ; Fri, 6 May 2022 01:13:13 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id y21so7832647edo.2 for ; Fri, 06 May 2022 01:13:13 -0700 (PDT) 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=48nMT+gnh1vkPS6WcET22AquP1bwix2Jf1ru/W7jPF0=; b=IbrYmItb1Lwf9ZtD0tkpri3RJ99v62ia17YxLpggBwo/VDMDe1Ih5cYt7l1XNud4Wt RLP7ykYKZ1toxZIj8GYyTDh5v4Y1YXumWCCqv4+blU/qCeqYrOSl6U0+YdllXrDZBWRk VoQm4xJTCGGR+pbuWS8Ql7SqkviUCoRy7B/MFqRZ7S3qCCRYYui1N5cd13Gl8lJ9JvHz 3tBQEVPh1Adm0NplEjXWdn8LiuGyqpyjIJ/atYzZzorngDy1gyG4jgl1qZp4QkR9FVkY ae0j32HSF9IIpSv3S5OL8MAyV6A17UPBHK38D53THuUVNcHIfXAEpOQ35Wem0hgUnQGN PMKA== 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=48nMT+gnh1vkPS6WcET22AquP1bwix2Jf1ru/W7jPF0=; b=eEoCElGf/lVguHx6fYnzR3AR4iqYBqtvmI3M5qGKvLF8LqEEidwHwV1yYu2fXRDjxx tozyl30p6DszCxe5agF0tJkogWomz1xAeaAUz/6TTA9xoRc3bRBORf2SaY5OM1Onssx3 sEf3qcHS55dTy6gGM+84Cj8C8I6RnnlOOPMIcexiTYeGaJFogB5auLdWc01hVF9yJyXA QIF5k7VqfkfU3zNuJTXFerle/5z1wiexCfGw9OEeUtCEGpjo5jhgtxJ9fTFOyZc5uSdD bcHQvMqWvwFeB41TPL6l265FhmzpHeJKJjUKR3qiox/Vjq/SAs82/pkRTPuhaEhRfg9Q qSlw== X-Gm-Message-State: AOAM530HTirFQ6Sda2ISnrmACB2M02kHhnjqD6NKOvD67VoLwqdyRMPA +Pv1J6K0ktNj2YSBGz6j4QZeX1DcAWyK7esqoIo= X-Received: by 2002:a05:6402:1a42:b0:424:20bb:3e37 with SMTP id bf2-20020a0564021a4200b0042420bb3e37mr2214361edb.29.1651824792251; Fri, 06 May 2022 01:13:12 -0700 (PDT) MIME-Version: 1.0 References: <20220506073623.2679-1-puyou.lu@gmail.com> In-Reply-To: <20220506073623.2679-1-puyou.lu@gmail.com> From: Andy Shevchenko Date: Fri, 6 May 2022 10:12:36 +0200 Message-ID: Subject: Re: [PATCH v2] lib/string_helpers: fix not adding strarray to device's resource list. To: Puyou Lu Cc: Andy Shevchenko , Andrew Morton , Kees Cook , Petr Mladek , Linus Walleij , Guenter Roeck , Chris Down , linux-kernel@vger.kernel.org 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 Fri, May 6, 2022 at 9:36 AM Puyou Lu wrote: > > Add allocated strarray to device's resource list. This is a must to > automatically release strarray when the device disappears. LGTM, Reviewed-by: Andy Shevchenko Thanks! > Fixes: acdb89b6c87a ("lib/string_helpers: Introduce managed variant of kasprintf_strarray()") > Signed-off-by: Puyou Lu > > --- > > Change since v1: > also set 'n' of strarray https://lore.kernel.org/lkml/20220506022845.26750-1-puyou.lu@gmail.com/ > > --- > lib/string_helpers.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/lib/string_helpers.c b/lib/string_helpers.c > index 4f877e9551d5..5ed3beb066e6 100644 > --- a/lib/string_helpers.c > +++ b/lib/string_helpers.c > @@ -757,6 +757,9 @@ char **devm_kasprintf_strarray(struct device *dev, const char *prefix, size_t n) > return ERR_PTR(-ENOMEM); > } > > + ptr->n = n; > + devres_add(dev, ptr); > + > return ptr->array; > } > EXPORT_SYMBOL_GPL(devm_kasprintf_strarray); > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko