From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753873Ab3LNPRO (ORCPT ); Sat, 14 Dec 2013 10:17:14 -0500 Received: from forward16.mail.yandex.net ([95.108.253.141]:47038 "EHLO forward16.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753602Ab3LNPRN (ORCPT ); Sat, 14 Dec 2013 10:17:13 -0500 From: Evgeniy Polyakov Envelope-From: drustafa@yandex.ru To: Levente Kurusa , LKML Cc: GregKH In-Reply-To: <1386962557-8899-5-git-send-email-levex@linux.com> References: <1386962557-8899-1-git-send-email-levex@linux.com> <1386962557-8899-5-git-send-email-levex@linux.com> Subject: Re: [PATCH 4/4] w1: call put_device if device_register fails MIME-Version: 1.0 Message-Id: <216611387034229@web23g.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 14 Dec 2013 19:17:09 +0400 Content-Transfer-Encoding: 7bit Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi 13.12.2013, 23:23, "Levente Kurusa" : > Currently, memsetting and kfreeing the device is bad behaviour. > The device will have a reference count of 1 and hence can cause trouble > because it has kfree'd. Proper way to handle a failed device_register > is to call put_device right after it fails. Looks good to me, thank you Greg, please pull it into your treee > Signed-off-by: Levente Kurusa Acked-by: Evgeniy Polyakov