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 10F9D2F617C; Sat, 12 Sep 2026 18:43:21 +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=1789238602; cv=none; b=j10I+axF2AYNQbhKrINidqKe0ABjxgpHSa3oHrNhPtpYexkNNgWqof9KlvGoqI/82G+M9uhshn97URFYefI321XZIJ/FHI0wH6eGKDz1hmcciL3gpURF7p7mjDbntnm6m+PJWx9P18W7khbSLlyp5vrq8k2pjABKiQsikz+r8AM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789238602; c=relaxed/simple; bh=BmeA2m/ReEsbmiQuarQIsKHz6xZ30hwA+HalW1Q0xKM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t4FcKQ8Fi1ejfjnnptiuYFysIVFc/Ud/v5tcBY+HywWMY+TLBGsVK7YB61RCPUHgFusXunPtDZD/wH5PUCQFzSHby3nd1X1dZzV6kAHwV+rontVXzYxtNTq/6dJkjDa5+Bv5Aq9gzJ/FpKN7hde9KL7/CqAjWnDjxccDVwAG/UM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=peclDf7D; 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="peclDf7D" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 171C31F000FF; Sat, 12 Sep 2026 18:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789238601; bh=dGzcPOGR+tK0FlmW3Wutz81BaejwPpV2XCXERkTJovo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=peclDf7DykScDgNJcamz/IYGvujLcHRAQHXqHRd7pGFiduQbX00CTFpHd7ClA7niJ nKYGucYgZm1hvV5eSiCGwGZCI3/sQgoATqW7sKw4RhgLGQ/Zgi+V6qSxvUcqkPjDMW Lzoo0bTOiRqXmwwkl9EasmycduTM4vXmiNpoFaEg= 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 5.15 452/935] staging: fbtft: Use sysfs_emit_at() to print to sysfs file Date: Sat, 12 Sep 2026 08:58:02 +0200 Message-ID: <20260912065537.195147621@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065526.833703348@linuxfoundation.org> References: <20260912065526.833703348@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 5.15-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