From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] AudioScience HPI driver: Unsafe memory management when allocating control cache Date: Tue, 02 Nov 2010 07:39:04 +0100 Message-ID: References: <4CCF3CF8.7060300@audioscience.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 646F61037F2 for ; Tue, 2 Nov 2010 07:39:06 +0100 (CET) In-Reply-To: <4CCF3CF8.7060300@audioscience.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Eliot Blennerhassett Cc: alsa-devel@alsa-project.org, Jesper Juhl List-Id: alsa-devel@alsa-project.org At Tue, 02 Nov 2010 11:19:36 +1300, Eliot Blennerhassett wrote: > > On 30/10/10 08:35, Jesper Juhl wrote: > > I noticed that sound/pci/asihpi/hpicmn.c::hpi_alloc_control_cache() does > > not check the return value from kmalloc(), which may fail. > > If kmalloc() fails we'll dereference a null pointer and things will go bad > > fast. > > There are two memory allocations in that function and there's also the > > problem that the first may succeed and the second may fail and nothing is > > done about that either which will also go wrong down the line. > > Thanks Jesper, > > your changes look fine. > > Acked-by: Eliot Blennerhassett OK, applied now. Thanks! Takashi