Skip to contentSkip to conversation

Staging: wlan-ng: Handle error condition.

PATCH Superseded Sandhya Bankar 1 participant 1 message Mar 6, 2016 Staging

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Staging: wlan-ng: Handle error condition.

Handle error condition.
Below semantic patch found,their is double assignment to 'result' variable.so instead of deleting double assignment,handling error condition for "result = mkimage(..)". @@
expression e1,e2,e3;
@@

(
(<+...e1++...+>)=e2;
|
(<+...e1--...+>)=e2;
|
(<+...++e1...+>)=e2;
|
(<+...--e1...+>)=e2;
|
e1=e2;
e1 = <+...e1...+>;
|
*e1=e2;
*e1=e3;

---

Changes in v2:
* No change.
*Compile this patch to check nothing is broken.

drivers/staging/wlan-ng/prism2fw.c | 4 ++++

 1 file changed, 4 insertions(+)
drivers/staging/wlan-ng/prism2fw.c +4 -0
index 8fc80df..35fd5fb 100644
@@ -333,6 +333,10 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr,
 
 	/* Make the image chunks */
 	result = mkimage(fchunk, &nfchunks);
+	if (result) {
+		netdev_err(wlandev->netdev, "Failed to make image chunk.\n");
+		return 1;
+	}
 
 	/* Do any plugging */
 	result = plugimage(fchunk, nfchunks, s3plug, ns3plug, &pda);
Signature · 1 line
1.8.3.4