From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752930AbcFAV4x (ORCPT ); Wed, 1 Jun 2016 17:56:53 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42922 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752505AbcFAV4u (ORCPT ); Wed, 1 Jun 2016 17:56:50 -0400 Date: Wed, 1 Jun 2016 14:56:49 -0700 From: Andrew Morton To: Zhouyi Zhou Cc: penberg@kernel.org, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, Zhouyi Zhou , Jens Axboe Subject: Re: [PATCH] relay: fix potential memory leak Message-Id: <20160601145649.b1ca852264601ffaa451e6d4@linux-foundation.org> In-Reply-To: <1464777927-19675-1-git-send-email-yizhouzhou@ict.ac.cn> References: <1464777927-19675-1-git-send-email-yizhouzhou@ict.ac.cn> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 1 Jun 2016 18:45:27 +0800 Zhouyi Zhou wrote: > when relay_open_buf fails in relay_open, program will goto free_bufs, > but chan is nowhere freed. OK. > In addition, give warning to users who forget to provide create file > hook. Why? What's the value in this? If the user didn't provide ->create_buf_file then setup_callbacks() will provide them with create_buf_file_default_callback() - what's wrong with that?