public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IPMI: fix comparison in demangle_device_id
@ 2007-10-22  4:10 Corey Minyard
  0 siblings, 0 replies; only message in thread
From: Corey Minyard @ 2007-10-22  4:10 UTC (permalink / raw)
  To: Andrew Morton, Linux Kernel; +Cc: Adrian Bunk, Stian Jordet

From: Corey Minyard <cminyard@mvista.com>

Coverity spotted some incorrect code in a recent change to the IPMI
driver; this patch make sure the data is really long enough to pull
the manufacturer id and product id out of a get device id message.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Cc: Adrian Bunk <bunk@kernel.org>
Cc: Stian Jordet <liste@jordet.net>
---
Index: linux-2.6.23/include/linux/ipmi_smi.h
===================================================================
--- linux-2.6.23.orig/include/linux/ipmi_smi.h
+++ linux-2.6.23/include/linux/ipmi_smi.h
@@ -173,7 +173,7 @@ static inline int ipmi_demangle_device_i
 	id->firmware_revision_2 = data[3];
 	id->ipmi_version = data[4];
 	id->additional_device_support = data[5];
-	if (data_len >= 6) {
+	if (data_len >= 11) {
 		id->manufacturer_id = (data[6] | (data[7] << 8) |
 				       (data[8] << 16));
 		id->product_id = data[9] | (data[10] << 8);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-10-22  4:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-22  4:10 [PATCH] IPMI: fix comparison in demangle_device_id Corey Minyard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox