From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pa0-f47.google.com ([209.85.220.47]:33076 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751067AbbFKIAv (ORCPT ); Thu, 11 Jun 2015 04:00:51 -0400 Received: by padev16 with SMTP id ev16so49111199pad.0 for ; Thu, 11 Jun 2015 01:00:51 -0700 (PDT) Date: Thu, 11 Jun 2015 17:01:15 +0900 From: Sergey Senozhatsky To: Mauro Carvalho Chehab Cc: Andrew Morton , Jan Kara , Linux Media Mailing List , Mauro Carvalho Chehab , "Kirill A. Shutemov" , Konstantin Khlebnikov , Johannes Weiner , Joonsoo Kim , Naoya Horiguchi , Cyrill Gorcunov , Christian Borntraeger , Andrea Arcangeli , Hans Verkuil , Paul Cassella , Steve Capper , "Aneesh Kumar K.V" , linux-mm@kvack.org Subject: Re: [PATCH 1/9] mm: Provide new get_vaddr_frames() helper Message-ID: <20150611080115.GB515@swordfish> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-media-owner@vger.kernel.org List-ID: On (06/10/15 06:20), Mauro Carvalho Chehab wrote: [..] > + > +/** > + * frame_vector_destroy() - free memory allocated to carry frame vector > + * @vec: Frame vector to free > + * > + * Free structure allocated by frame_vector_create() to carry frames. > + */ > +void frame_vector_destroy(struct frame_vector *vec) > +{ > + /* Make sure put_vaddr_frames() got called properly... */ > + VM_BUG_ON(vec->nr_frames > 0); > + if (!is_vmalloc_addr(vec)) > + kfree(vec); > + else > + vfree(vec); minor: kvfree(vec); -ss