Skip to content

Commit

Permalink
IPMI: fix comparison in demangle_device_id
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Corey Minyard authored and Linus Torvalds committed Oct 30, 2007
1 parent cc5f916 commit 64e862a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/ipmi_smi.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static inline int ipmi_demangle_device_id(const unsigned char *data,
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);
Expand Down

0 comments on commit 64e862a

Please sign in to comment.