From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 E9C7C3E51D8 for ; Mon, 8 Jun 2026 20:30:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780950612; cv=none; b=MMJopAEd8igESKlWD9C6PLoNEMgPwfXiidCtpJqmN83ITLoFUybHWLu5NtPbt7/B/H6/jKtWSYAIl4nA7NBe9z2in77zYBwD/WC3yqHoxhIerxcVamWKVzSxhG+dwzsYK77mojUqdrih0dw/T0TmaEDNzfAILEgq9BpbuLdxpDQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780950612; c=relaxed/simple; bh=tBO6EHZ7m3EmVy0SfD+RfgsKaS54zMv6O+QHMuDtz4g=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=sUCbS5+X16/scqMVvNC2rhoA6fkAijUUj8ZP72F3PAz/0HjJHAcgRIb8L6sBhNrE7odhazEsoUpB1lxQlv66Xhs2icqWQ9weDLKmYk3SG+xi720QkRVMb6qpRajVWdxEteqA76kBp81h4yVyD6b4cgg5iZZcCA6sjTdexbONG+I= 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=KcahCdKl; arc=none smtp.client-ip=209.85.128.49 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="KcahCdKl" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-490bb83a3f6so40114115e9.0 for ; Mon, 08 Jun 2026 13:30:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780950608; x=1781555408; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=tBO6EHZ7m3EmVy0SfD+RfgsKaS54zMv6O+QHMuDtz4g=; b=KcahCdKlB26orKlkAyhz/qS7aphZDrI8ejkrHrYcTCbhqiZOrUXn5SGc+2t6QtAP6K 98mFQwAyEPki1e0Li3liy42sKS2cAKObJ0J9bh78igv0/c6gKHgYSzePbam+tlQUoDzy HPuzDIE/+/MtQBR9R2mv/H20TMeFLraji7VL6YyDdFilqRwXVk3jAN7Glv58JwGQIWWu TUoyKTYmfZKFjXKdkgPz8+AcGhTiRsSeAGksxTzWJS3Qrl9NrgPnb1zI4qJIKBo4VO6a KUaFfVEh90es6rdedwThAbjN6AEtUc4/xo8kqYiaSFU5wi3hbpT9Q4HPXgqpqT1TeH7+ ZwjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780950608; x=1781555408; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tBO6EHZ7m3EmVy0SfD+RfgsKaS54zMv6O+QHMuDtz4g=; b=JX5UTe13fImG+L3wwgQCPeEVVak72BNxB49i6c/yfpizx4d5skNGs9KTrVk3mF2aJs Xqu2KE1i2Ts3/BobUQdLBWjRo+akrCq14FkV3PsFARxtHfGlsMALB/4WMEPEJEjWc9aj /p8VuS7UIQX/FX8TppWGTQWSeXzHjYcU3YS//hd98HQwE5Ovz73djKJuLknCQ2BJhGmv gIjIyQdAUBFWhJx7qZM+/dSNVT+6cQQqd65LRFH13JQ5kJG7HU8TSqZVP+2FylPG8zc5 WC1/4KWuEhyB2JP+tziGBY4blrtZc1df7HTiQA9BHVIrt6JJSYynpcJY9YsaRC6O9vvA WM0A== X-Forwarded-Encrypted: i=1; AFNElJ8zOUubaDXpMv6UKK9fL61KcsY5nJOtIyi8zy8MJmW7urbQzdHBcL53xxFQHCvjeQF/qi4jNbVuT20+fFs=@vger.kernel.org X-Gm-Message-State: AOJu0YznyWJpWB9xjTjGqPymlpGgjLvqH902wN7esK3xxWQ1tCp5klKy Gno2eivB7ZqRDsae9r2AugAY3CaMUTDGtUJufGNcauU3IMqk5Ek5D//i X-Gm-Gg: Acq92OFnt+xP5QJ4LK+WvCN9P26PWtXxzpecWjb8OTYEBtOQJPggyplJkwUZ+Li9Q0B LH3a5jArM5IV6f+7FhU9oD5mR6N8Ram0BoK4pMm/2M8TQ4wnL5yFMZpC7yZRAyD7gFDKCW1Y2MX 6dUu+C/6hcnFUWq6l4F1diHnoKvq1CNKCE4jXkNKrOe/vF+XFhBcpmKU7871Xx52QyOcuKUXnhV WPC5krz3obr9Yvlc0pDMdJoBOLLo78KNyReRxoVVz9uzSwFqXdXAU5ChoYk9t1dtaUzfMZLBAZH wLmc+sdDsCW1KaVg9Mfhcq4syUHa/twHTVPQd3aGes9B2/q9xlJ5Dy7FpywW+pT9khhRzbtp6CL nHOdOj6AtOvsHXF6tRXyde3r/KC+ib9Ju4u2ZBIGTVqyG1BalVuvqRNV+qt+/sysFEPRap2M0BQ 1n+YtNuGz0YJdycTyd/w+YxUe0wRSwimmWCUpOXDJrlLVE/ZmTk17frsqHE3B7iWSGv7Odw0/h/ aLhudDsQc+G X-Received: by 2002:a05:600c:3b1f:b0:490:b9c3:6c48 with SMTP id 5b1f17b1804b1-490c2621dabmr295540605e9.29.1780950608202; Mon, 08 Jun 2026 13:30:08 -0700 (PDT) Received: from ?IPv6:2001:818:ea56:d000:56e0:ceba:7da4:6673? ([2001:818:ea56:d000:56e0:ceba:7da4:6673]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490bc39eb04sm430313545e9.6.2026.06.08.13.30.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 13:30:07 -0700 (PDT) Message-ID: Subject: Re: [PATCH] iio: backend: fix uninitialized data in debugfs From: Nuno =?ISO-8859-1?Q?S=E1?= To: Andy Shevchenko , Dan Carpenter Cc: Jonathan Cameron , Maxwell Doose , Nuno Sa , Olivier Moysan , David Lechner , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Date: Mon, 08 Jun 2026 21:31:14 +0100 In-Reply-To: References: <20260526191946.409160c8@jic23-huawei> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-2.fc42) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Fri, 2026-06-05 at 11:28 +0300, Andy Shevchenko wrote: > On Fri, Jun 05, 2026 at 09:12:38AM +0300, Dan Carpenter wrote: > > On Thu, Jun 04, 2026 at 05:55:08PM +0300, Andy Shevchenko wrote: > > > On Thu, Jun 04, 2026 at 01:42:11PM +0300, Dan Carpenter wrote: > > > > On Thu, Jun 04, 2026 at 01:38:50PM +0300, Dan Carpenter wrote: > > > > > =C2=A0=C2=A0 168=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 ret =3D sscanf(buf, "%i %i", &back->cached_reg_addr, &val); > > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^^^ > > > > > Uninitialized variable. > > > >=20 > > > > s/variable/data/. > > >=20 > > > With what I asked in the previous reply and what you explained there > > > (thanks, btw!) I still think your patches are not fully correct. They > > > will require to atomically write all or nothing. If we want support > > > partial writes we need to go with that differently (reset ppos when > > > we got enough or more than enough data). > >=20 > > Requiring writes to syfs and debugfs be atomic is pretty normal and > > works well in practice.=C2=A0 These are very small writes. >=20 > Perhaps. In any case your patch will break existing partial writes, right= ? > I'm still considering that resetting ppos is the right thing to do. Just > need to find where the best place is to do that. I think anyone doing partial writes on a debugfs interface like this one is= very unlikely but it is a fair point, yes. But can't we be more relaxed on debug= fs? No userspace app should be relying on debugfs in order to work (though I know = that actually happens). Anyways, this is one of those interesting edge cases and easy enough to get= wrong. I guess we should either: 1. Improve simple_write_to_buffer() docs; 2. Or come up with a new simple_write_once_to_buffer() helper? - Nuno S=C3=A1