From nobody Mon Sep 28 23:07:57 2026 Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83A972D3EF2 for ; Sat, 15 Aug 2026 18:27:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786818476; cv=none; b=F/7dfnZeIEf/rIUMpo7Yc5Ipc1DZVS6PQlkKzgTfKZCuBngCiOKkUweVeBjQnRXQf74tqj2kLtNkYEHiB3LtV4mfbOSozoVOfphJ/VaQgFxxbq3PkqKe4/HOtwVEcQDdCqFEe8jZE5hdLVumXCwQLrHtDC/apG7MMrUnjHzYK/4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786818476; c=relaxed/simple; bh=EZYpRtCk/IWXuA1hpLjgUkksiqsRpGfb+L16mV3/6WQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j5YrW/Q3bcKV7QrRjPSrMjlbgpYtykOlIJSHd0EtgPDr6Pmyhhj1jz76Diixp3r/FTptQ6vxTD0tzuEHheHKfyBnS5XTeA6vEeGKRIf971zmRzMpAYzTj1vMsSzUpfR+PtNGmLfSiiBgurZf0NHQ61bktnMKYJWmwSjgC0LAHqc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Nuta2BrH; arc=none smtp.client-ip=209.85.128.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Nuta2BrH" Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-80bb41f7f3cso17602677b3.2 for ; Sat, 15 Aug 2026 11:27:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786818474; x=1787423274; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=NPNqM78QIlfa21ZWXnecQfff0vtz8768AVWjbj/1skw=; b=Nuta2BrHOp8fdwnS9HE1H/S3zeegZbPD6H2uKaApyQ0ZRl/ZbLSfPOaq70QiHgYkar o0DlSeqfxYvUhMhuTTXc31VeuR1NVyaLI3KGC1S/OTMlSaQi1ShBcp6kbJOfdAJ8GTJC DTd6kvarg7P8FIqPRDHi7W0oeOT2dO1mEw+g7DmuUrdx48aPOsvqWo3P0oYY2llklMUs amOc5yLcJiXvYJKzT22dSTIoCROHcYGYjCFvN6Fe3jl2KaKgBR5U4ot8jMi/MrMM3t3W ImWmG8M0B+1Q0QVtC31nOXW5x2rKcH3A2ZsckS6MJWwsunBndyegxr2o26TcaxAQfM+a t3Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786818474; x=1787423274; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=NPNqM78QIlfa21ZWXnecQfff0vtz8768AVWjbj/1skw=; b=ROLImQ8ypx1dLl0bK0Lug0UTRLCnV++luV5z2EUnbal95MxkNOPkiKOIXSAuADDtZB Ht3uUtQaMOHaW+MclVXeoanFX+Mwdv9XsJqgLMhMBdbMZAizxOFr8kKWw3vg57vKWM22 aDelChzq2UXsfOTXQuvtDND6efaeFSHXS3tS6KdTbwoL5A8WRm+lu3yU+NxtCEE2nYtv 8N/xOUpviedenJHVAApsjNo/mQuvWAlUfBrTqzWKNOTennQ52+WPXPyy7B5TDqbuLO9P TXuviEiflmLW7HzAvA+htPv7Yry5nP5xbJfpK7LfFCvSV+C7As6NfN8CYUD+KcPdsOoE /TMA== X-Forwarded-Encrypted: i=1; AHgh+RoKOOW3t9mNiVSg0jJdu0lA+PQADDSI7XPL/kXcJDEQEhpcoOPwQUsj3Obp5nSgGkuKoUZuR+AjbVX97ww=@vger.kernel.org X-Gm-Message-State: AOJu0Yy9SzZpt/5ps7c8AENbV7Yu8QYF7wkmJFsoZMiAHk3dtTW0Xuen Wv9AT75Y4IVOE52Hb0r9R5c8iaGybXB2fEYmncWqULL/4b1NtnPPSwM= X-Gm-Gg: AR+sD134QxNabPWgCz8sAhaNG5YqQQZyvN68TBbTlvSDFJYp4rqdqFsxzaKsgOE2gAv UG1kqoLip97blUagwGB0AgCn/88zEmqZPyiNUi74IIaEdHiVcNVc5/HyHfRS223JfeAABy/xeov w1BVY3bOBKz1dAienaXwRCT1ftRt3iN8G39AA+pT2eFSa+EmSkFWdro+VOszNRnV7ENShyIZXrV PqM93eC5WUFY4lNAxKvmWxb0eNgdl2aj06sp95iIcA98F9vCZh0Vib9HsQ1UVm398vaejzp7AWE ERg5UOm97Aa1zi1TMnFe3ObwBkFw62pgj0qa5BOw20SUb9Dgb+D3kHYwHLhl3s3/+hUSIFalVZf eVHOKj0pCGyvcSH/+mLfx80aFS18EgPmpR1jGUhble/QMOa/rjjUj0X6csPxfEEhkEF1xYgT2PE OrIwuoa6nMDdPct7T2anXtYyIG9cpQB9dFNRaC3FYLhjC/cHk6m0xPMnAyX/oF/I3jXfUXt4PXt AGwT09a9GiGyisBjLQ= X-Received: by 2002:a53:ee12:0:b0:66c:707b:60eb with SMTP id 956f58d0204a3-66c72be077dmr3191221d50.23.1786818474512; Sat, 15 Aug 2026 11:27:54 -0700 (PDT) Received: from daffodil.tailc06997.ts.net ([163.152.162.75]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-66c75c5dd24sm2598154d50.6.2026.08.15.11.27.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Aug 2026 11:27:53 -0700 (PDT) From: Arka Mondal To: jic23@kernel.org, Michael.Hennerich@analog.com, nuno.sa@analog.com Cc: andy@kernel.org, andriy.shevchenko@intel.com, dlechner@baylibre.com, rohitsarkar5398@gmail.com, venkat.prashanth2498@gmail.com, linux@analog.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Arka Mondal Subject: [PATCH v2 1/3] iio: imu: adis16480: fix unprotected debugfs reads Date: Sun, 16 Aug 2026 03:27:24 +0900 Message-ID: <20260815182726.11796-2-arkamondalofficial@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260815182726.11796-1-arkamondalofficial@gmail.com> References: <20260815182726.11796-1-arkamondalofficial@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The firmware_revision and firmware_date file operations are open coded and never call debugfs_file_get(), which debugfs_create_file_unsafe() requires. debugfs_remove_recursive() therefore does not wait for a read in progress, and unbind frees the iio_dev underneath it. Use debugfs_create_file() instead. Fixes: 9bf94f836e32 ("imu:adis16480: fix debugfs_simple_attr.cocci warnings= ") Signed-off-by: Arka Mondal Reviewed-by: Andy Shevchenko --- Notes: Compile tested only; no relevant hardware available. drivers/iio/imu/adis16480.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c index e009f3824768..254b7ff25b66 100644 --- a/drivers/iio/imu/adis16480.c +++ b/drivers/iio/imu/adis16480.c @@ -309,9 +309,9 @@ static void adis16480_debugfs_init(struct iio_dev *indi= o_dev) if (!IS_ENABLED(CONFIG_DEBUG_FS)) return; =20 - debugfs_create_file_unsafe("firmware_revision", 0400, + debugfs_create_file("firmware_revision", 0400, d, adis16480, &adis16480_firmware_revision_fops); - debugfs_create_file_unsafe("firmware_date", 0400, + debugfs_create_file("firmware_date", 0400, d, adis16480, &adis16480_firmware_date_fops); debugfs_create_file_unsafe("serial_number", 0400, d, adis16480, &adis16480_serial_number_fops); --=20 2.55.0 From nobody Mon Sep 28 23:07:57 2026 Received: from mail-yx1-f52.google.com (mail-yx1-f52.google.com [74.125.224.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A81DF3438A1 for ; Sat, 15 Aug 2026 18:28:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786818499; cv=none; b=FlHoB5pthjcX0elSD5G+SYJidCD6CiYgzq+VPUOEAgY55yvNe31dtmWa527/I321bXxbEyMjy2D6XJYUFW8fsPxUyvUIE/zSLruA/P66IWtVYKLuyoiOm1w14e9EgT6WXqptczNGUOcZ116pFKEqHeFvHnMtk23A+/SF/+fP55g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786818499; c=relaxed/simple; bh=gEw34VENern9leYlo6WUQSo7332q+Lp9FfLfUyozZz4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cG3yXCJGHLj0oFJ38jWXqZItqw/NrkPBChptpZH7aYdNW43DrbW6NeWUxJyrWexdprs6WaNucFvPOB6HXy+sPeQq12q0w8tlnJXPzNxZe/vTDt+5y/3enNje2JwEiUspgxM5jNNCu01jnJEaWgtyrpUQiPt9LnCr8UsH62yWcM8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jYjHSaDh; arc=none smtp.client-ip=74.125.224.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jYjHSaDh" Received: by mail-yx1-f52.google.com with SMTP id 956f58d0204a3-66b2c08803cso2311324d50.2 for ; Sat, 15 Aug 2026 11:28:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786818496; x=1787423296; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=LDaZRH1XbTfk3hXUc+K+eSj2XbWKoDFGNk633rhoJVM=; b=jYjHSaDhtaNBYOB1gxcDHUcRmFtsDTIXUdlify75n6SNYiPfiUOsPA2bf62+1UNoAJ kQps3hziQkj3e9ElefO7Ow9+Bw31lpV+2j544BGfTkhm7oXTFmrsKvxX/Py/qqcVFhLu EWljHuShuhE9laBXx8PcyiIM/B03D+j7W5rNlgr+jXLaRYh6vecLqv8XyQAEih4bCAeS UX+klaF9ICY9g2gJ72OHOPMzDUIbvmnw7AwImwDWN31wLtVeli1kv0i5Nll1vfvQEiui LFcRzECU0wUBo+DyTZN62PFPBRxZ0Iid1kqOFCHCc0qOqtj7e+kGHSpB2aksyKt0wX19 kAPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786818496; x=1787423296; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=LDaZRH1XbTfk3hXUc+K+eSj2XbWKoDFGNk633rhoJVM=; b=ASGfj8o5JkmAPg8ashHK30ER8k4jvnphoySexang5Y/Axaz6IRxTe37sff4TPdSiSq E/+2Q3niLLCdY8kjW2rzUztOjEmIDaCyfKjeZejXKrnsK6EXA/S2XnT3jm89e48WKqQA sEeUBjZwcss629tntpLaEvFzUrRTLjoLhrz49LuuYBLKDpbAKp0MuFuqguydIeojDR/h bg0LZNhBbhxLjU/Fq881m5wSi+jgsd4AHtD/ijoYradIVwqPObvEgEBOt1FJHKQ/1Hce FQjOHqQDk8pCqUy23rncWwJZf5orNKjWFeS3rnhkmOLyhni8eiNOWaWIY2c4bupjGuaM Optw== X-Forwarded-Encrypted: i=1; AHgh+RrEb8j3TUBiTwpVVdLHB9uuHvIgS+9B+3Su7mJ5dNzMJ1Xtuz7CIsAVdN69Ow24dSWE/hZubRlENPZ//30=@vger.kernel.org X-Gm-Message-State: AOJu0YzHiG0mUZ2KIojhZEvlwE4E4zypVT/JcrHF2wzzuVz7L3eI9P+e lodeyYmCgQUyMSbmZJ/9W8/f6u3O1zDuam5WPPKsVQmcmBMRao5M2q4= X-Gm-Gg: AR+sD12FWdA0MUk8oBLPSksjXB55wKNs82Y27UZGWkNVXgsG25uOEUNAyEfzFAMgVzh wnEVWDQ9oP1qVDk261TQN6HlYP5m3zdNTcsvTLnCAF2vJk+NImXUNrjp2vuC1J7bkAST8FZyBoV qBMMDrLJ3IAAvUONSronsP56DC4LKzOcO8C8idaxzVDpGjHfVl/vWtMghtdSCrzGYXAuHKtRIUx mAeUIGWUraKj/hxz7e1aWX5byIGDvA0wFEEZ55DrZNdwsCOf7haMsuG8CYgCAFiDhxNzfZ8+Qgy IO4Mmo0qSK7nAeBSLQrhVZnbOgPfTfB3LP3B7A9jkiJbg6MfcwNhE8N7uaeuzizP3HNBfUqi/cP aXZFUrsFkHyDBnlqqn5UcQWuMAO9MyQd1UrBjYHr3Ub9uiLxoNi3c+JBe3i15XIBbi99qAln+h7 N8f/9w1DbLeOPEGaIoNnTPF0KAEq+6bpb3oqke2vDzlefIUsPt2m167HYBjLppRrwcHzSuHb8Lr tYmB7+qcxEFz8cst/m6 X-Received: by 2002:a05:690e:4195:b0:66b:d2b5:2db5 with SMTP id 956f58d0204a3-66c72b30aacmr4411880d50.9.1786818496549; Sat, 15 Aug 2026 11:28:16 -0700 (PDT) Received: from daffodil.tailc06997.ts.net ([163.152.162.75]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-66c75c5dd24sm2598154d50.6.2026.08.15.11.28.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Aug 2026 11:28:15 -0700 (PDT) From: Arka Mondal To: jic23@kernel.org, Michael.Hennerich@analog.com, nuno.sa@analog.com Cc: andy@kernel.org, andriy.shevchenko@intel.com, dlechner@baylibre.com, rohitsarkar5398@gmail.com, venkat.prashanth2498@gmail.com, linux@analog.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Arka Mondal Subject: [PATCH v2 2/3] iio: imu: adis16400: fix unprotected debugfs reads Date: Sun, 16 Aug 2026 03:27:25 +0900 Message-ID: <20260815182726.11796-3-arkamondalofficial@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260815182726.11796-1-arkamondalofficial@gmail.com> References: <20260815182726.11796-1-arkamondalofficial@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" adis16400_serial_number_fops is open coded and never calls debugfs_file_get(), so debugfs_remove_recursive() does not wait for a read in progress and unbind frees the iio_dev underneath it. Commit ae1d37a9bb4b ("iio: imu: adis16400: use DEFINE_DEBUGFS_ATTRIBUTE instead of DEFINE_SIMPLE_ATTRIBUTE") converted product_id and flash_count to DEFINE_DEBUGFS_ATTRIBUTE, which protects itself, but moved all three files to debugfs_create_file_unsafe(). serial_number prints three registers as "%.4x-%.4x-%.4x" and DEFINE_DEBUGFS_ATTRIBUTE() formats a single u64, so it cannot be converted without changing what the file returns. adis16475 and adis16550 already use debugfs_create_file() for their open coded files. Use it here too. Fixes: ae1d37a9bb4b ("iio: imu: adis16400: use DEFINE_DEBUGFS_ATTRIBUTE ins= tead of DEFINE_SIMPLE_ATTRIBUTE") Signed-off-by: Arka Mondal --- Notes: Compile tested only; no relevant hardware available. drivers/iio/imu/adis16400.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/imu/adis16400.c b/drivers/iio/imu/adis16400.c index 36323ad149e0..7e85c1b8dc16 100644 --- a/drivers/iio/imu/adis16400.c +++ b/drivers/iio/imu/adis16400.c @@ -280,7 +280,7 @@ static void adis16400_debugfs_init(struct iio_dev *indi= o_dev) return; =20 if (st->variant->flags & ADIS16400_HAS_SERIAL_NUMBER) - debugfs_create_file_unsafe("serial_number", 0400, + debugfs_create_file("serial_number", 0400, d, st, &adis16400_serial_number_fops); if (st->variant->flags & ADIS16400_HAS_PROD_ID) debugfs_create_file_unsafe("product_id", 0400, --=20 2.55.0 From nobody Mon Sep 28 23:07:57 2026 Received: from mail-yx1-f53.google.com (mail-yx1-f53.google.com [74.125.224.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CC463C0628 for ; Sat, 15 Aug 2026 18:28:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786818513; cv=none; b=SLay/jiKElqhcBTTwHCQabxdRuxBLTxCSECulBmmDD0/PxOe+g4u6/vriH75zo4H9MWBsOm7VgSg0VjXnrv9l5LuAOwXOhdlKST8eIN8JYkmV5x9ROF8U5td6nS3L4AX1WN0QcUuAC0TMaWRHdg3xPsRF/YzZ1bhxPCKY/EJlng= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786818513; c=relaxed/simple; bh=AglfuJjYGVuU1/b1mszIc81oX/HIQ6PLpq8iRJ8r/CI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=InYffQzq5Gi11dpmfiwdh2mt7cQWJOV/GUzAiRaUCkVVxG7JVQQ5Nc1Ze3QsUECzl7FY7Hwhb0BJAh5NmxZfnzMhygXXE9Wpdgq0v9dIDfz5q3L6cGIEhhPtohT36M4uGhCGJhu8dbp2mBRcvAMwNTVTH1mCuQn32xbP5+viC0o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hcXiNt5w; arc=none smtp.client-ip=74.125.224.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hcXiNt5w" Received: by mail-yx1-f53.google.com with SMTP id 956f58d0204a3-66c70e2904dso2357442d50.1 for ; Sat, 15 Aug 2026 11:28:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786818511; x=1787423311; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=LVhZeEwCh3t3Qz3apXzpM8jvwUwGQcQC73T/JHuxtFs=; b=hcXiNt5wQuSelF39f0m7tPBPQ0vXMla8hI+1tjCe2xffahGCnF6rtfPR62jr/HUbuC VcwJT176mXvz6jJmZsEfJKwzRs0jZQYP5wESykGIJ7HZk3CAESIH6hCMeTVBwwCL3/Jf JM09/LIcHRTC7YCjEfMrELqcy0azM627XuUpis9enMakJNAy39tx4ZRhwA74QCkPu6dB 0sGJyvUEzjdP2ogZtX/fAAG/UF3HnzN2UhUoqMeO4UXMqmQC6JttiNLB/xvp4iG+zeJ8 GwaJin/O0OW60vnyRbCf1LPTsY3PxfJIPjdYhHDQkfrrcZeNYkyoPK4bPj8nrnVUKM8u rnPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786818511; x=1787423311; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=LVhZeEwCh3t3Qz3apXzpM8jvwUwGQcQC73T/JHuxtFs=; b=DaS1m0A9ZNUUAswlYHcGNtghbqU8Ox+KFcSd3S2VliQ7GZNyRrEn9wJnBbnhhid89i UhbqJcWtCg3TkBq4bQVZMaPyZOMd8F2GoWvHVvQgTGrRPcjMAdT/4B03zZ3qzRXX+bkt XhRsLK1C0DY8Q/mvrDd2Ax7nWpyRQkSFXcm9QEuWcngRXMbbMT8YJZ4/A0p3a4djAj/S qKuaBFpICA2jMXiOsWcNQxQXnphVyoDTiMRHLPM3EJxPBWKoX2ieb/vJfie2fkqBSisr F33HOpFFXi27uYsOesBozpjrjCRy9eSQBlbc4MRqZH/ZcTT6Rgvc99fle2lnRrsddj2P KekA== X-Forwarded-Encrypted: i=1; AHgh+RqsQhPVtv8BRvUVVYqBzbIH8gLH/Je4Wpyhg3gev+eEYZQIUIah0hGOOF8qOMMLZ4XxGyU9Y7kJfYsaGJQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwLUQoEqNFGNLafXqYgTPjkNhbADhGUMUi7rmDvV8P9/KwArgBC jKrVedyo2doM8H2cAJ7AtuNxUtL5QegzmeeOqgRWBJ+gF8fxXM5iUVQ= X-Gm-Gg: AR+sD10uKoThyc7V6Sv8LoTxrQln7a6wHXKCX9UnWJB4Yq8+xMLJKa2uVfxbwyq4+Hx gt1sw8gkpuQ3tcm+MYxcSJ1zdZWK3n4yA2tcJWxJbnrJ7UQiiRb2eM4G32ZZ+q9mfqXUsFQNDoJ oci6n5+E/a8k27YipLLZHvQOq+y/4ZGc2LFOj3juOLohu0MZLnMnw8fjZmKkHTEFi28NYcKJ0RW F5M8fWMt8PWsvgqEenyDYOgKn6bbiD2kBrgKWJmR0Wa/dzxu7GFrdJpiwx57IZhkAkb1rsQrnO3 qSGwpXpWsnXpfZUrFhDtWD2pWI9BqP2XsW90eksmaD6VDTNsFmHGTAqO40Irpo5X1aonY8Db1bT PoEbJBiUEAJS5aMgbpWNq2gO7KDY3u9v7HkKUUmmmiUuPFeg+FLtluaramlkP7UroPQSiawuHH1 JzE93CGQmRnfJ2lqm7brGIVpz3kJTiWCjTWnV7cMdru0+Z1thm11DscDm9XpF1JS3scLOhJvJ/5 3oRkrKYmCxljz5Z3O4= X-Received: by 2002:a05:690e:1c09:b0:66b:2d5b:9fe1 with SMTP id 956f58d0204a3-66c72d04491mr6346023d50.45.1786818511332; Sat, 15 Aug 2026 11:28:31 -0700 (PDT) Received: from daffodil.tailc06997.ts.net ([163.152.162.75]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-66c75c5dd24sm2598154d50.6.2026.08.15.11.28.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Aug 2026 11:28:30 -0700 (PDT) From: Arka Mondal To: jic23@kernel.org, Michael.Hennerich@analog.com, nuno.sa@analog.com Cc: andy@kernel.org, andriy.shevchenko@intel.com, dlechner@baylibre.com, rohitsarkar5398@gmail.com, venkat.prashanth2498@gmail.com, linux@analog.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Arka Mondal Subject: [PATCH v2 3/3] iio: gyro: adis16136: fix unprotected debugfs reads Date: Sun, 16 Aug 2026 03:27:26 +0900 Message-ID: <20260815182726.11796-4-arkamondalofficial@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260815182726.11796-1-arkamondalofficial@gmail.com> References: <20260815182726.11796-1-arkamondalofficial@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The serial_number file operations are open coded and never call debugfs_file_get(), which debugfs_create_file_unsafe() requires. debugfs_remove_recursive() therefore does not wait for a read in progress, and unbind frees the iio_dev underneath it. Use debugfs_create_file() instead. Fixes: 9aaea09b4cbd ("gyro:adis16136: fix debugfs_simple_attr.cocci warning= s") Signed-off-by: Arka Mondal Reviewed-by: Andy Shevchenko --- Notes: Compile tested only; no relevant hardware available. drivers/iio/gyro/adis16136.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/gyro/adis16136.c b/drivers/iio/gyro/adis16136.c index 369c7428e1ef..adcf54b67a28 100644 --- a/drivers/iio/gyro/adis16136.c +++ b/drivers/iio/gyro/adis16136.c @@ -145,7 +145,7 @@ static int adis16136_debugfs_init(struct iio_dev *indio= _dev) struct adis16136 *adis16136 =3D iio_priv(indio_dev); struct dentry *d =3D iio_get_debugfs_dentry(indio_dev); =20 - debugfs_create_file_unsafe("serial_number", 0400, + debugfs_create_file("serial_number", 0400, d, adis16136, &adis16136_serial_fops); debugfs_create_file_unsafe("product_id", 0400, d, adis16136, &adis16136_product_id_fops); --=20 2.55.0