[alsa-devel] [PATCH - asihpi 5/6] Avoid null pointer dereference.

linux at audioscience.com linux at audioscience.com
Fri Aug 22 07:26:32 CEST 2008


From: Eliot Blennerhassett <eblennerhassett at audioscience.com>


Signed-off-by: Eliot Blennerhassett <eblennerhassett at audioscience.com>

diff --git a/pci/asihpi/hpi6205.c b/pci/asihpi/hpi6205.c
index daa359d..1654070 100644
--- a/pci/asihpi/hpi6205.c
+++ b/pci/asihpi/hpi6205.c
@@ -2126,6 +2126,9 @@ static short Hpi6205_TransferData(
 	u32 dwTimeOut, dwTemp2;
 	struct bus_master_interface *interface = pHw6205->pInterfaceBuffer;
 
+	if (!pData)
+		return HPI_ERROR_INVALID_DATA_TRANSFER;
+
 	dwDataSize &= ~3L;	/* round dwDataSize down to nearest 4 bytes */
 
 	/* make sure state is IDLE */
-- 
1.5.4.3



More information about the Alsa-devel mailing list