Skip to contentSkip to conversation

Staging: intel_sst: fix memory leak

PATCH In review Dan Carpenter 3 participants 3 messages Nov 13, 2010 – Nov 16, 2010

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

PATCH 1/1 Staging: intel_sst: fix memory leak

The original code set "str_info->decode_ibuf" to NULL so the kfree() is no-op.

---
This is a static checker thing. I don't have the hardware to test this myself so please check it carefully.

drivers/staging/intel_sst/intel_sst_stream_encoded.c +1 -1
index d4e94f1..09993d6 100644
@@ -1270,7 +1270,7 @@ finish:
 	dbufs->output_bytes_produced = total_output;
 	str_info->status = str_info->prev;
 	str_info->prev = STREAM_DECODE;
-	str_info->decode_ibuf = NULL;
 	kfree(str_info->decode_ibuf);
+	str_info->decode_ibuf = NULL;
 	return retval;
 }
Acked-by on v1 1/1
#1 lore raw
Quoted 23 lines

-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Saturday, November 13, 2010 2:28 PM
To: Greg Kroah-Hartman
Cc: Harsha, Priya; Koul, Vinod; Alan Cox; [email protected]; [email protected]
Subject: [patch] Staging: intel_sst: fix memory leak

The original code set "str_info->decode_ibuf" to NULL so the kfree() is no-op.

---
This is a static checker thing. I don't have the hardware to test this myself so please check it carefully.

drivers/staging/intel_sst/intel_sst_stream_encoded.c +0 -0
index d4e94f1..09993d6 100644

drivers/staging/intel_sst/intel_sst_stream_encoded.c finish: · line 1276

Quoted 8 lines
drivers/staging/intel_sst/intel_sst_stream_encoded.c +1 -1
@@ -1270,7 +1270,7 @@ finish:
 	dbufs->output_bytes_produced = total_output;
 	str_info->status = str_info->prev;
 	str_info->prev = STREAM_DECODE;
-	str_info->decode_ibuf = NULL;
 	kfree(str_info->decode_ibuf);
+	str_info->decode_ibuf = NULL;
 	return retval;
 }