Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1449101pxf; Fri, 2 Apr 2021 10:44:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNNVKFC26xhS2fr6cxP0W/jjJ/Zr2vqSZUKafg8N5dI3XNKnv2bKvAwuvX/Fpo3bMyaFh+ X-Received: by 2002:aa7:d98b:: with SMTP id u11mr17083874eds.352.1617385442362; Fri, 02 Apr 2021 10:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617385442; cv=none; d=google.com; s=arc-20160816; b=U8L24/WKyrRBW5c/VnoAy/44s2C+NoW0gMxOPEfXIJ5KHS8WmxgGurIRSLt4qN3qcS KDmqNaBPjeL8RvvCW193W67CEKGL+PO4oyogOQV2BgxbvzY0b7DAJC0lEeeJkYfodYqs jpJCaqq+jkGchrrxqlXVGx7g7bRfeFhmj001o/TT8FJg+ZmgnbZy0oEGRGCXgpCNfxFK 7n+zRvNcZbFk4EzXhDh7oPmL8DktIMMRNQyC1UwoeJb/ff3R1ZSeVhrf5m6VY3g54G/W Wbx4qUMIhU2c5OY5Ew87Ac2Sp6DD9BO+9dJtM8OZi8yOYhxiTYZS+k64NP9OcD5J4aQG MEUw== 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:dkim-signature; bh=ScmcEaVFBSOKM3zbhWaVisr6S40D1F1cKzKJmwlPJfo=; b=dDI5gat/XnLngyq49ywLPRRQuFX1gQeiub4oqN5MRW+I8R7ill5eDurdh/DbcbwHI7 pn0gSJSWIKOEmSzGPAf7ccluopegNHtWFLovB181Hto4Qovv2wp2abDw+3uKjEzrO1WJ e4E+SYJOfFTHnOnboIsPFwWmpuGBIQYqKnjwzMY3sc/qVZYHT0BXpLry1BQ1A+l2YBqn cN0ONA8m0IX10YuGXhqDQaz6K3ZZ2kz/48VqUQV4rS3V2dZh6CQidwSOxV4hUaGJQ8+f lT3Rt78MRxB2adAZY8Wi78DIJ1JaBfu+/oiBGee/K166YkkUbOjWlKa/80tIEeuh385E CDew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=C0J9vA79; 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=deviqon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w25si7352943eju.430.2021.04.02.10.43.39; Fri, 02 Apr 2021 10:44:02 -0700 (PDT) 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=@deviqon.com header.s=google header.b=C0J9vA79; 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=deviqon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235025AbhDBRm5 (ORCPT + 99 others); Fri, 2 Apr 2021 13:42:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234759AbhDBRmi (ORCPT ); Fri, 2 Apr 2021 13:42:38 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66BA0C061788 for ; Fri, 2 Apr 2021 10:42:33 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id h13so6128566eds.5 for ; Fri, 02 Apr 2021 10:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=deviqon.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ScmcEaVFBSOKM3zbhWaVisr6S40D1F1cKzKJmwlPJfo=; b=C0J9vA79mBFuZpfOe+6Jlc0UkD+uSD8LGQqq1NfRtQTSSwAvXSxPoq3d12+wchrr50 Hvk7MchZ6HGAHFZpzMhT5RCIBsyxEAXDFd8ZriqCCkT9SpXHpSRH+c8yV0aq9ILqgZWW QGKrBeyOMBYH4iAcsp2ZW4W9UIdzQOX00CPc6yfyI4GvQ8uru3iHUJn2QLFoTVqBwZm8 SZXyFIbdaoawI2YgQ3acyzJ4UQoWpJxDRByo9leo3/bfSVq6ONoSpCg5FLGA9L8GPwlH 3dHW4oVG4hf3RFW//ZlfnRW9xyIUL4bO7SokOzNE9/obl2p8wmFHptTK8S/JaCLB7ttn HUeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ScmcEaVFBSOKM3zbhWaVisr6S40D1F1cKzKJmwlPJfo=; b=R40W1voDSzU7+lQPs+/HZ5MFHo3pHx6xlBJpE1+xXbEJE9T51cntUEtm+P+7TOVtoN ndOwP9mCc+fZKtAA4P0GnLzuFZZfkHpqFx70k1wIRIXKQkPjCpm6ak0yNzuI1RaWIXxd NZ39bjjr8L0imRn5dBSSWrze4URVAprSIS/gsyLd7N3G6tO5rkLIWN3sb59xO64R5XS9 /0oo3foW9mbXwSenK59yIFBWxIDGnXqfU1+RKRLKzzHP29Y7rOedwGaZ4997R80O5YzI igSLEvNbyqVR6iOTN9N/zqtCCs9AwnN+axFSgaWq9PFNlx1GNNGM6v/h5BsDfPX0A/7z 63/w== X-Gm-Message-State: AOAM533B9Lo0nCIqBapqT+8NbjN/rNohSVJCeIqQHh1K0BrbxdqpkNAS Jv7jnrLAnb+/YMpRLyGW9eq6N+J+dIbiUroJ X-Received: by 2002:aa7:cd64:: with SMTP id ca4mr16357828edb.334.1617385351814; Fri, 02 Apr 2021 10:42:31 -0700 (PDT) Received: from localhost.localdomain ([188.27.130.90]) by smtp.gmail.com with ESMTPSA id m9sm4475270ejo.65.2021.04.02.10.42.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Apr 2021 10:42:31 -0700 (PDT) From: Alexandru Ardelean To: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Cc: jic23@kernel.org, Alexandru Ardelean , Marek Szyprowski Subject: [PATCH] iio: buffer: use sysfs_attr_init() on allocated attrs Date: Fri, 2 Apr 2021 20:42:26 +0300 Message-Id: <20210402174226.630346-1-aardelean@deviqon.com> 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 When dynamically allocating sysfs attributes, it's a good idea to call sysfs_attr_init() on them to initialize lock_class_keys. This change does that. The lock_class_keys are set when the CONFIG_DEBUG_LOCK_ALLOC symbol is enabled. Which is [likely] one reason why I did not see this during development. I also am not able to see this even with CONFIG_DEBUG_LOCK_ALLOC enabled, so this may [likely] be reproduce-able on some system configurations. This was reported via: https://lore.kernel.org/linux-iio/CA+U=DsrsvGgXEF30-vXuXS_k=-mjSjiBwEEzwKb1hJVn1P98OA@mail.gmail.com/T/#u Fixes: 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") Reported-by: Marek Szyprowski Signed-off-by: Alexandru Ardelean --- @Marek: could you maybe test this on your setup? I haven't been able to reproduce this on mine. Thanks Alex drivers/iio/industrialio-buffer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index ee5aab9d4a23..06b2ea087408 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -1309,6 +1309,7 @@ static struct attribute *iio_buffer_wrap_attr(struct iio_buffer *buffer, iio_attr->buffer = buffer; memcpy(&iio_attr->dev_attr, dattr, sizeof(iio_attr->dev_attr)); iio_attr->dev_attr.attr.name = kstrdup_const(attr->name, GFP_KERNEL); + sysfs_attr_init(&iio_attr->dev_attr.attr); list_add(&iio_attr->l, &buffer->buffer_attr_list); -- 2.30.2