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>] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 25 Sep 2021 22:04:30 +0200
From:   Michael Estner <michaelestner@....de>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     michaelestner@....de, Lee Jones <lee.jones@...aro.org>,
        linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: [PATCH] avoid crashing the kernel

To avoid chrashing the kernel I use WARN_ON instead.

Signed-off-by: Michael Estner <michaelestner@....de>
---
 drivers/staging/most/i2c/i2c.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/most/i2c/i2c.c b/drivers/staging/most/i2c/i2c.c
index 7042f10887bb..e1edd892f9fd 100644
--- a/drivers/staging/most/i2c/i2c.c
+++ b/drivers/staging/most/i2c/i2c.c
@@ -68,7 +68,7 @@ static int configure_channel(struct most_interface *most_iface,
 	struct hdm_i2c *dev = to_hdm(most_iface);
 	unsigned int delay, pr;

-	BUG_ON(ch_idx < 0 || ch_idx >= NUM_CHANNELS);
+	WARN_ON(ch_idx < 0 || ch_idx >= NUM_CHANNELS);

 	if (channel_config->data_type != MOST_CH_CONTROL) {
 		pr_err("bad data type for channel %d\n", ch_idx);
@@ -122,7 +122,7 @@ static int enqueue(struct most_interface *most_iface,
 	struct hdm_i2c *dev = to_hdm(most_iface);
 	int ret;

-	BUG_ON(ch_idx < 0 || ch_idx >= NUM_CHANNELS);
+	WARN_ON(ch_idx < 0 || ch_idx >= NUM_CHANNELS);

 	if (ch_idx == CH_RX) {
 		/* RX */
@@ -167,7 +167,7 @@ static int poison_channel(struct most_interface *most_iface,
 	struct hdm_i2c *dev = to_hdm(most_iface);
 	struct mbo *mbo;

-	BUG_ON(ch_idx < 0 || ch_idx >= NUM_CHANNELS);
+	WARN_ON(ch_idx < 0 || ch_idx >= NUM_CHANNELS);

 	if (ch_idx == CH_RX) {
 		if (!polling_rate)
--
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ