aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ipmi_smi.h
diff options
context:
space:
mode:
authorCorey Minyard <cminyard@mvista.com>2007-10-29 17:37:13 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-30 11:06:55 -0400
commit64e862a579015d229b8e40b6bc4ac3612e9656e1 (patch)
tree3e3033c61b438f8a1451d36a930b8657a23cadad /include/linux/ipmi_smi.h
parentcc5f916e90a811dd8f809b4d17409f98e74b237c (diff)
IPMI: fix comparison in demangle_device_id
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> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/ipmi_smi.h')
-rw-r--r--include/linux/ipmi_smi.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index 56ae438ae510..6e8cec503380 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -173,7 +173,7 @@ static inline int ipmi_demangle_device_id(const unsigned char *data,
173 id->firmware_revision_2 = data[3]; 173 id->firmware_revision_2 = data[3];
174 id->ipmi_version = data[4]; 174 id->ipmi_version = data[4];
175 id->additional_device_support = data[5]; 175 id->additional_device_support = data[5];
176 if (data_len >= 6) { 176 if (data_len >= 11) {
177 id->manufacturer_id = (data[6] | (data[7] << 8) | 177 id->manufacturer_id = (data[6] | (data[7] << 8) |
178 (data[8] << 16)); 178 (data[8] << 16));
179 id->product_id = data[9] | (data[10] << 8); 179 id->product_id = data[9] | (data[10] << 8);