summaryrefslogtreecommitdiff
path: root/lib/ipmi_fru.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ipmi_fru.c')
-rw-r--r--lib/ipmi_fru.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/ipmi_fru.c b/lib/ipmi_fru.c
index 17afe5f..40f98e7 100644
--- a/lib/ipmi_fru.c
+++ b/lib/ipmi_fru.c
@@ -958,7 +958,7 @@ fru_area_print_chassis(struct ipmi_intf * intf, struct fru_info * fru,
}
}
- if (fru_area != NULL) {
+ if (fru_data != NULL) {
free(fru_data);
fru_data = NULL;
}
@@ -1082,7 +1082,7 @@ fru_area_print_board(struct ipmi_intf * intf, struct fru_info * fru,
break;
}
- if (fru_area != NULL) {
+ if (fru_data != NULL) {
free(fru_data);
fru_data = NULL;
}
@@ -1217,7 +1217,7 @@ fru_area_print_product(struct ipmi_intf * intf, struct fru_info * fru,
break;
}
- if (fru_area != NULL) {
+ if (fru_data != NULL) {
free(fru_data);
fru_data = NULL;
}
@@ -1564,8 +1564,6 @@ static void ipmi_fru_oemkontron_get( int argc, char ** argv,uint8_t * fru_data,
static int badParams=FALSE;
int start = off;
int offset = start;
- int length = len;
- int i;
offset += sizeof(struct fru_multirec_oem_header);
if(!badParams){
@@ -2147,7 +2145,6 @@ static void ipmi_fru_picmg_ext_print(uint8_t * fru_data, int off, int length)
{
unsigned int entries;
unsigned int feeds;
- unsigned int feedcnt;
unsigned int hwaddr;
unsigned int i;
unsigned int id;
@@ -3700,7 +3697,7 @@ ipmi_fru_upg_ekeying(struct ipmi_intf * intf,
char * pFileName,
uint8_t fruId)
{
- struct fru_info fruInfo;
+ struct fru_info fruInfo = {0};
uint8_t *buf = NULL;
uint32_t offFruMultiRec = 0;
uint32_t fruMultiRecSize = 0;
@@ -4775,13 +4772,12 @@ f_type, uint8_t f_index, char *f_string)
checksum = 0;
/* Calculate Header Checksum */
- for( i = header_offset; i < header_offset
- + fru_section_len - 1; i ++ )
+ for (i = 0; i < fru_section_len - 1; i++)
{
checksum += fru_data[i];
}
checksum = (~checksum) + 1;
- fru_data[header_offset + fru_section_len - 1] = checksum;
+ fru_data[fru_section_len - 1] = checksum;
/* Write the updated section to the FRU data; source offset => 0 */
if( write_fru_area(intf, &fru, fruId, 0,
@@ -4850,8 +4846,6 @@ ipmi_fru_set_field_string_rebuild(struct ipmi_intf * intf, uint8_t fruId,
struct fru_info fru, struct fru_header header,
uint8_t f_type, uint8_t f_index, char *f_string)
{
- uint8_t msg_data[4];
- uint8_t checksum;
int i = 0;
uint8_t *fru_data_old = NULL;
uint8_t *fru_data_new = NULL;