From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0C29344DAA; Sat, 12 Sep 2026 14:20:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789222802; cv=none; b=WY1QR92vTsg2yJgAVn0mKjTa634TaxXLKGmaO3ZiquHeASWXMUBUdJQLrLD6sP+BE6DyDEw95hTK3or9N7p9OKUoIxvKiuwR9oWG+6I4lMI6lpNfTleIuQmvLSRgED9GOjWSJBAhQWe9bvc7OHJvWAavlQ1BZYmPDkYKc0RVt74= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789222802; c=relaxed/simple; bh=gBDES6jbjCQ3qfebnOKqcd/TNBzBoinri4nfMs3ee/g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OxCv9KpOxiVKSe/TSTUchjl4GpwSQNdeyavUmHzhzZjEhdmRvWAz8fgDqJIObm1R/JOjn/cIqpuOuMnx21paDNd7x+hvf7runmWauOfwggwsLelnc9KfJ5xZ1sxb1WF9nKOqY7WYY5O0s0zN7ltrI8q/eXfqjNk5+l6P7XgGVns= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WHdar6eX; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="WHdar6eX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60A111F000FF; Sat, 12 Sep 2026 14:19:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789222801; bh=6lDNR29yENJcUUCf6L8dKJJpoK2Kwwcx37FVk5KIHRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=WHdar6eXrvGmtF9m8SNIbgFmWsGLSqNBYgOaGY16A/tTINUOtqpfXF+d7X+5OrWCp u/UVS5b4EWyeocwkv6ZXa2eBaQdblr7/FXGyID9+j5w0f6ak5qGSB8IoFx85sXrD8E 79hwptgMnAjJMGbcA2aXzzuKfEInX3TqHIhfmu+c= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dan Carpenter , Andy Shevchenko , Sasha Levin Subject: [PATCH 6.6 0659/1424] staging: fbtft: Use sysfs_emit_at() to print to sysfs file Date: Sat, 12 Sep 2026 08:51:31 +0200 Message-ID: <20260912065622.052266515@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.279695368@linuxfoundation.org> References: <20260912065607.279695368@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter [ Upstream commit 221192a784c25e28b489a7e75fabf59be4f63d57 ] This scnprintf() uses the wrong limit. It should be "PAGE_SIZE - len" instead of just PAGE_SIZE. We're not going to hit the limit in real life since we are printing at most FBTFT_GAMMA_MAX_VALUES_TOTAL (128) u32 values, however, it's still worth fixing. Use sysfs_emit_at() to fix this since this is a sysfs file. Fixes: c296d5f9957c ("staging: fbtft: core support") Signed-off-by: Dan Carpenter Reviewed-by: Andy Shevchenko Link: https://patch.msgid.link/ah_Y_Y2RtqeGxchF@stanley.mountain Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/fbtft/fbtft-sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/fbtft/fbtft-sysfs.c b/drivers/staging/fbtft/fbtft-sysfs.c index 39e8d28066cbe..809bf350af253 100644 --- a/drivers/staging/fbtft/fbtft-sysfs.c +++ b/drivers/staging/fbtft/fbtft-sysfs.c @@ -102,7 +102,7 @@ sprintf_gamma(struct fbtft_par *par, u32 *curves, char *buf) mutex_lock(&par->gamma.lock); for (i = 0; i < par->gamma.num_curves; i++) { for (j = 0; j < par->gamma.num_values; j++) - len += scnprintf(&buf[len], PAGE_SIZE, + len += sysfs_emit_at(buf, len, "%04x ", curves[i * par->gamma.num_values + j]); buf[len - 1] = '\n'; } -- 2.53.0