All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Staging: wlan-ng: Handle error condition.
@ 2016-03-06 12:04 Sandhya Bankar
  0 siblings, 0 replies; only message in thread
From: Sandhya Bankar @ 2016-03-06 12:04 UTC (permalink / raw)
  To: outreachy-kernel

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; 

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---

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(+)

diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
index 8fc80df..35fd5fb 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -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);
-- 
1.8.3.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-03-06 20:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-06 12:04 [PATCH v2] Staging: wlan-ng: Handle error condition Sandhya Bankar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.