From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Rientjes Subject: Re: [PATCH] Input: evdev - Fix incorrect kfree of err_free_client after vzalloc Date: Wed, 11 Jun 2014 23:49:02 -0700 (PDT) Message-ID: References: <1402537537-17945-1-git-send-email-ytk.lee@samsung.com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Return-path: In-Reply-To: <1402537537-17945-1-git-send-email-ytk.lee@samsung.com> Sender: linux-kernel-owner@vger.kernel.org To: Yongtaek Lee Cc: rydberg@euromail.se, dmitry.torokhov@gmail.com, daniels@collabora.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-input@vger.kernel.org On Thu, 12 Jun 2014, Yongtaek Lee wrote: > This bug was introduced by commit 92eb77d ("Input: evdev - fall back > to vmalloc for client event buffer"). > > vzalloc is used to alloc memory as fallback in case of failure > of kzalloc. But err_free_client was not considered on below case. > 1. kzalloc fail > 2. vzalloc success > 3. evdev_open_device fail > 4. kfree > > So that address checking is needed to call correct free function. > > Signed-off-by: Yongtaek Lee > Reviewed-by: Daniel Stone Acked-by: David Rientjes