[PATCH] drxk: Use BUG() for invalid numberOfParameters in QAMDemodulatorCommand()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If numberOfParameters is not 2 or 4, we log a warning and then
continue.  Depending on compiler version and options, this may be
recognised as an impossible case or may otherwise provoke the warning
that 'status' is uninitialised.  Using the more forceful BUG() avoids
this warning, and makes it harder to ignore incorrect usage.

Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
 drivers/media/dvb-frontends/drxk_hard.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c
index 8b4c6d5..6da00ac 100644
--- a/drivers/media/dvb-frontends/drxk_hard.c
+++ b/drivers/media/dvb-frontends/drxk_hard.c
@@ -5459,8 +5459,7 @@ static int QAMDemodulatorCommand(struct drxk_state *state,
 				     numberOfParameters, setParamParameters,
 				     1, &cmdResult);
 	} else {
-		printk(KERN_WARNING "drxk: Unknown QAM demodulator parameter "
-			"count %d\n", numberOfParameters);
+		BUG();
 	}
 
 error:


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux