Skip to contentSkip to conversation

staging: r8712u: cleanup pointer type in r8712_setassocsta_cmd()

PATCH In review Dan Carpenter 2 participants 2 messages Oct 25, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: r8712u: cleanup pointer type in r8712_setassocsta_cmd()

This seems like a cut and paste bug. Smatch complains that we don't allocate enough memory for a set_stakey_rsp struct. In fact this is used as a set_assocsta_rsp struct throughout and that also matches the name of the function.

drivers/staging/rtl8712/rtl871x_cmd.c +2 -2
index 659683e..31f31dbf 100644
@@ -814,7 +814,7 @@ u8 r8712_setassocsta_cmd(struct _adapter *padapter, u8 *mac_addr)
 	struct cmd_priv			*pcmdpriv = &padapter->cmdpriv;
 	struct cmd_obj			*ph2c;
 	struct set_assocsta_parm	*psetassocsta_para;
-	struct set_stakey_rsp		*psetassocsta_rsp = NULL;
+	struct set_assocsta_rsp		*psetassocsta_rsp = NULL;
 
 	ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
 	if (ph2c = NULL)
@@ -825,7 +825,7 @@ u8 r8712_setassocsta_cmd(struct _adapter *padapter, u8 *mac_addr)
 		kfree((u8 *) ph2c);
 		return _FAIL;
 	}
-	psetassocsta_rsp = (struct set_stakey_rsp *)_malloc(
+	psetassocsta_rsp = (struct set_assocsta_rsp *)_malloc(
 			    sizeof(struct set_assocsta_rsp));
 	if (psetassocsta_rsp = NULL) {
 		kfree((u8 *)ph2c);
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dan Carpenter

This seems like a cut and paste bug. Smatch complains that we don't allocate enough memory for a set_stakey_rsp struct. In fact this is used as a set_assocsta_rsp struct throughout and that also matches the name of the function.

Thanks,

Larry

Quoted 24 lines
drivers/staging/rtl8712/rtl871x_cmd.c +2 -2
index 659683e..31f31dbf 100644
@@ -814,7 +814,7 @@ u8 r8712_setassocsta_cmd(struct _adapter *padapter, u8 *mac_addr)
  	struct cmd_priv			*pcmdpriv = &padapter->cmdpriv;
  	struct cmd_obj			*ph2c;
  	struct set_assocsta_parm	*psetassocsta_para;
-	struct set_stakey_rsp		*psetassocsta_rsp = NULL;
+	struct set_assocsta_rsp		*psetassocsta_rsp = NULL;
 
  	ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
  	if (ph2c = NULL)
@@ -825,7 +825,7 @@ u8 r8712_setassocsta_cmd(struct _adapter *padapter, u8 *mac_addr)
  		kfree((u8 *) ph2c);
  		return _FAIL;
  	}
-	psetassocsta_rsp = (struct set_stakey_rsp *)_malloc(
+	psetassocsta_rsp = (struct set_assocsta_rsp *)_malloc(
  			    sizeof(struct set_assocsta_rsp));
  	if (psetassocsta_rsp = NULL) {
  		kfree((u8 *)ph2c);