From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752507AbaKJKGG (ORCPT ); Mon, 10 Nov 2014 05:06:06 -0500 Received: from cantor2.suse.de ([195.135.220.15]:34435 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752066AbaKJKGF (ORCPT ); Mon, 10 Nov 2014 05:06:05 -0500 Date: Mon, 10 Nov 2014 11:06:02 +0100 Message-ID: From: Takashi Iwai To: Sudip Mukherjee Cc: Jaroslav Kysela , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ALSA: korg1212: cleanup of printk In-Reply-To: <20141110072026.GA12553@sudip-PC> References: <1415603671-12510-1-git-send-email-sudipm.mukherjee@gmail.com> <20141110072026.GA12553@sudip-PC> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.4 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Mon, 10 Nov 2014 12:50:26 +0530, Sudip Mukherjee wrote: > > hi Takashi, > I have a doubt regarding this korg1212. > snd_korg1212_free_pcm is just making korg1212->pcm as NULL. But are we not supposed to release the allocated memory ? > in snd_pcm_new we are allocating memory. The allocated memories by snd_pcm_new() are freed automatically. The private_free callback is for extra memory that is allocated in the outside. But in this case, it's the chip object that will be freed snd_korg1212_dev_free(), so snd_korg1212_free_pcm() doesn't do anything. (Actually it can be dropped.) Takashi