From 359f90982cba0ba8db39b683de05dcb2de64b979 Mon Sep 17 00:00:00 2001
From: Alexander Stein <alexander.stein@systec-electronic.com>
Date: Tue, 1 Nov 2011 09:40:07 +0100
Subject: [PATCH] ALSA: hda_hwdep: Fix possible buffer overflow
Git-commit: 359f90982cba0ba8db39b683de05dcb2de64b979
Patch-mainline: 3.2-rc1
References: FATE#313695

If a line in the firmware file is larger than the given buffer size (and
so the firmware file size), size is set to a value larger than the actual
buffer size. This results in an overflow in the buffer passed.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

---
 sound/pci/hda/hda_hwdep.c |    2 --
 1 file changed, 2 deletions(-)

--- a/sound/pci/hda/hda_hwdep.c
+++ b/sound/pci/hda/hda_hwdep.c
@@ -756,8 +756,6 @@ static int get_line_from_fw(char *buf, i
 	}
 	if (!fw->size)
 		return 0;
-	if (size < fw->size)
-		size = fw->size;
 
 	for (len = 0; len < fw->size; len++) {
 		if (!*p)
