From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (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 7E88431F99B for ; Wed, 10 Jun 2026 07:08:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781075335; cv=none; b=dhSfv1RCPcoi/8UDWqEyC/J7rA59mtzdCnanDl5KAgOQl2J9e9UKCCEkqbNRl24p9t4PocTAlyONJ5QbPUvDRaV8Qr43TXi6jU3e4IxcLrUcIuLXoHHT02WWqrS8baz1NNNF4n2JSKKo//haMhn8qgRIBZNx8Tpwe6m9xZ7IX0I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781075335; c=relaxed/simple; bh=jrcQ/583+R3CHJddOVqfeMRFjXhkgPkP3fN87Q62ZoM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nbjpe7vXeVjAyiNg6bLms153rf9oMW6g4I7NMW1WQFs7+VK5hbEyhS0PiBxu9PppR7qlQerONE41O8jY8+wHjIMuq6VDHb8IQDvk0DzrybxUOqWNA4MGmclwMf2asZr69X6rjG1mPV+Q2UJgVzUofVf3vt4KrTZfUJP2TMUs1N4= 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=lf55xpF/; arc=none smtp.client-ip=209.85.160.170 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="lf55xpF/" Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-517b1f2c6adso33082821cf.2 for ; Wed, 10 Jun 2026 00:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781075333; x=1781680133; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=rFFLmi2Zspzs29/Zve9KRNQHJogssJd0t8KLoa+VU+k=; b=lf55xpF/obQydV15uzESYRViJyqVvsIJOI1f6gz9JrKmeIVxS6XyHvsQGaIPzst8kg 3JWU7A5LTQTlDvVNwK3l38aMltxn/o51+c3UzmMt5qJQKA2AGEVsEPy1nd7ldKjnhYSe 6xxyzQCCzUcZehO+VMOmvfChsuDl06IfVlZoP0wB5ti0gYULZdgH0ZnSz9UNay7mv/v8 DZUlZnMm1k5v+XSk35CfT45FRCClXoyuaNYU7OY/N5yOkbM4JjiLANhpjEQuG5jR3U6h xrSe7Xmv/v5HY9+WiMlbRUsERkZpyRDTl413qSu2V9suDX8RMoJ1McdKuYtcnYKZkQRR ofBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781075333; x=1781680133; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rFFLmi2Zspzs29/Zve9KRNQHJogssJd0t8KLoa+VU+k=; b=WSal94FDr+Dj7HZAFIBh0ETyJ0cIZAS1QGiD/PoN+ftv7f9cI/ZpMwQOWFZZmR+12l 47tzPPWM+Z9KEGc2xSfCcefT0HCaSR7mQ0z4E4gvynb2mrWfzkSkLyKfNkrGnP61VkLv bJGpyu8Yze5BhseyMar5km3gzHaaZw0CYh4GXhL807mr4bovFxz5hZOKoIccEhY2MPt4 zf1X2PwAcbTIqfAL1rW82zoSEAJGMyCw5AVcHZgboD0zTWBWfCqL6S0oAuZfa0eT8+YH 1gdquRzv4519qA+ZnayOg21tGiWKUkDxl82fyRkRZ0su0OcqIra+V1nM4fTiwEiEZ8vQ ZnxQ== X-Forwarded-Encrypted: i=1; AFNElJ+wlxh1IrTWHf5ZfhQ7H028GW6UrLVXOPU0+83772L246yN8xJdgTYZDtyVqMLAtB5gWvJvcyc1t8YajjE=@vger.kernel.org X-Gm-Message-State: AOJu0YxLIIfHK0xmcYycvakB435zmasL366R7GUo2CnG461qBsCsye7l rYf4XCuqfZPlQxPN0vPvrhrr8NpcMb+3JwgM4vI0EJ72VOrRW47V0eKZ X-Gm-Gg: Acq92OH+hvjIcWY5TIva5GGsJW2+kXs2S5hQ8gdBwhC0T5WTciI35zfFBm1C3zQZTPW o8dVT8atLznJmf54eKnKh4+/uwFOiy2TmVN06IPPWmiyMF1whtvtcyuvaNqY5E0jap+mogCd4e8 q7M2UttBWHlWhf6JXPleg3BDVx1Ytvegf7B4E7yynmTKd9M9H5wIj8n+DPzDQerCZTLtWfVvK7F 4PBnoTKjssG0d2Qq3t350sK/cUy0rZBY2QBv6mrWYQjNEnJosVNA+ory6uXsV39uR0A/OE9Onn+ wxsrVacOk7I5vOED8g5iKWhBfljRtT2YCj3MboP2U2PPBBFCQ4FHxcVaDBGqNLauFY/rdBCFjRu ijxRVMv4mnV8Rxzo98jX1jUpcBugi8iEYrekYbMcXOTxDgFsldOu25O8r/fPTFTpC4RCqX7MIqb IP26POozK05lrfokm+1IPtxxnHuhc= X-Received: by 2002:a05:622a:2509:b0:516:daca:ea8a with SMTP id d75a77b69052e-51795a4149amr309829301cf.20.1781075333520; Wed, 10 Jun 2026 00:08:53 -0700 (PDT) Received: from localhost ([149.40.50.222]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-51775da6f41sm202565081cf.22.2026.06.10.00.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2026 00:08:51 -0700 (PDT) Date: Tue, 9 Jun 2026 09:19:54 +0300 From: Dan Carpenter To: Andy Shevchenko 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 Subject: Re: [PATCH] iio: backend: fix uninitialized data in debugfs Message-ID: References: <20260526191946.409160c8@jic23-huawei> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Jun 05, 2026 at 11:28:18AM +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: > > > > > 168 ret = sscanf(buf, "%i %i", &back->cached_reg_addr, &val); > > > > > ^^^ > > > > > Uninitialized variable. > > > > > > > > s/variable/data/. > > > > > > 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). > > > > Requiring writes to syfs and debugfs be atomic is pretty normal and > > works well in practice. These are very small writes. > > Perhaps. In any case your patch will break existing partial writes, right? partial writes never worked so this doesn't break anything that wasn't already broken. Another option I considered was just initializing the buffer, but returning -EINVAL is the right fix. regards, dan carpenter