diff mbox

ASoC: Intel: Fix a self assignment in sst_mem_block_alloc_scratch()

Message ID 20140413224631.1a1bdce1@spike (mailing list archive)
State Accepted
Commit dd1b94bf4920cc12545883faa43c014efbf61b1e
Headers show

Commit Message

Christian Engelmayer April 13, 2014, 8:46 p.m. UTC
Remove a self assignment in sst_mem_block_alloc_scratch(). When calculating
buffer sizes there is no need for statements without effect. Detected by
Coverity: CID 1195249.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
---
 sound/soc/intel/sst-firmware.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Mark Brown April 15, 2014, 11:13 a.m. UTC | #1
On Sun, Apr 13, 2014 at 10:46:31PM +0200, Christian Engelmayer wrote:
> Remove a self assignment in sst_mem_block_alloc_scratch(). When calculating
> buffer sizes there is no need for statements without effect. Detected by
> Coverity: CID 1195249.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/intel/sst-firmware.c b/sound/soc/intel/sst-firmware.c
index f768710..f24619a 100644
--- a/sound/soc/intel/sst-firmware.c
+++ b/sound/soc/intel/sst-firmware.c
@@ -505,9 +505,7 @@  struct sst_module *sst_mem_block_alloc_scratch(struct sst_dsp *dsp)
 
 	/* calculate required scratch size */
 	list_for_each_entry(sst_module, &dsp->module_list, list) {
-		if (scratch->s.size > sst_module->s.size)
-			scratch->s.size = scratch->s.size;
-		else
+		if (scratch->s.size < sst_module->s.size)
 			scratch->s.size = sst_module->s.size;
 	}