Skip to contentSkip to conversation

IPMI: fix comparison in demangle_device_id

PATCH New Corey Minyard 1 participant 1 message Oct 22, 2007 IPMI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IPMI: fix comparison in demangle_device_id

From: Corey Minyard <[email protected]>

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.

Cc Adrian Bunk <[email protected]>
Cc Stian Jordet <[email protected]>

---

include/linux/ipmi_smi.h +1 -1
Index: 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);