[PATCH] IPMI: fix issues reported by Coverity in ipmi_msghandler.c
[PATCH] IPMI: fix issues reported by Coverity in ipmi_msghandler.c

While looking to the report by Coverity in ipmi, I came across the
following issue:

The IPMI message handler relies on two defines which are the same -one in
include/linux/ipmi.h
#define IPMI_NUM_CHANNELS 0x10
and one in drivers/char/ipmi/ipmi_msghandler.
#define IPMI_MAX_CHANNELS       16
These are used interchangeably in ipmi_msghandler.c, but since the array
addr->channels[] is of size IPMI_MAX_CHANNELS, I have made a patch that
uses IPMI_MAX_CHANNELS for all the checks for the array index.

NOTE: You could probably remove the line that defines IPMI_NUM_CHANNELS
from ipmi.h, or move IPMI_MAX_CHANNELS to ipmi.h

Signed-off-by: Jayachandran C. <96cf2eaefe6ef0b41d6e16a8e12c96d2e6289942@gmail.com>
Cc: Corey Minyard <f2a05cc3f63c42acc07a3bbae0d4082a7c4f5388@acm.org>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas