Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751725AbdG1E4I (ORCPT ); Fri, 28 Jul 2017 00:56:08 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37046 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750785AbdG1E4H (ORCPT ); Fri, 28 Jul 2017 00:56:07 -0400 Date: Thu, 27 Jul 2017 21:56:01 -0700 From: Greg Kroah-Hartman To: Gilad Ben-Yossef Cc: linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Suniel Mahesh , Ofir Drang Subject: Re: [PATCH 1/3] staging: ccree: Replace kzalloc with devm_kzalloc Message-ID: <20170728045601.GA30772@kroah.com> References: <1501165654-30601-1-git-send-email-gilad@benyossef.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1501165654-30601-1-git-send-email-gilad@benyossef.com> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 695 Lines: 17 On Thu, Jul 27, 2017 at 05:27:32PM +0300, Gilad Ben-Yossef wrote: > From: Suniel Mahesh > > It is recommended to use managed function devm_kzalloc, which > simplifies driver cleanup paths and driver code. > This patch does the following: > (a) replace kzalloc with devm_kzalloc. > (b) drop kfree(), because memory allocated with devm_kzalloc() is > automatically freed on driver detach, otherwise it leads to a double > free. > (c) remove unnecessary blank lines. > > Signed-off-by: Suniel Mahesh > [gby: rebase on top of latest coding style fixes changes] > Acked-by: Gilad Ben-Yossef None of these 3 applied to my tree :(