lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250923175927.4380-1-raskar.shree97@gmail.com>
Date: Tue, 23 Sep 2025 23:29:27 +0530
From: Shrikant Raskar <raskar.shree97@...il.com>
To: hverkuil@...nel.org,
	mchehab@...nel.org
Cc: linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Shrikant Raskar <raskar.shree97@...il.com>
Subject: [PATCH] media: saa6588: Fix unsafe debug printk macro

The existing dprintk macro used an unwrapped `if` statement, which can lead
to logic errors when used in if/else constructs. This patch wraps the macro
in a do { } while (0) block to ensure safe usage.

This change resolves the following checkpatch error:
ERROR: Macros starting with if should be enclosed by a do - while loop to
avoid possible if/else logic defects

Signed-off-by: Shrikant Raskar <raskar.shree97@...il.com>
---
 drivers/media/i2c/saa6588.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/saa6588.c b/drivers/media/i2c/saa6588.c
index fb09e4560d8a..71d34d229564 100644
--- a/drivers/media/i2c/saa6588.c
+++ b/drivers/media/i2c/saa6588.c
@@ -50,7 +50,7 @@ MODULE_LICENSE("GPL");
 
 #define UNSET       (-1U)
 #define PREFIX      "saa6588: "
-#define dprintk     if (debug) printk
+#define dprintk(fmt, args...)  do { if (debug) printk(fmt, ##args); } while (0)
 
 struct saa6588 {
 	struct v4l2_subdev sd;
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ