Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754079Ab3EQIZW (ORCPT ); Fri, 17 May 2013 04:25:22 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:46223 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750742Ab3EQIZS (ORCPT ); Fri, 17 May 2013 04:25:18 -0400 MIME-Version: 1.0 Date: Fri, 17 May 2013 16:25:17 +0800 Message-ID: Subject: [PATCH] ipmi: add missing platform_device_put() on error in try_smi_init() From: Wei Yongjun To: minyard@acm.org, grant.likely@linaro.org, rob.herring@calxeda.com Cc: yongjun_wei@trendmicro.com.cn, openipmi-developer@lists.sourceforge.net, devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 995 Lines: 28 From: Wei Yongjun Add the missing platform_device_put() before return from try_smi_init() in the platform_device_add() fail case. Signed-off-by: Wei Yongjun --- drivers/char/ipmi/ipmi_si_intf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index af4b23f..3f6c390 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -3299,6 +3299,7 @@ static int try_smi_init(struct smi_info *new_smi) "Unable to register system interface device:" " %d\n", rv); + platform_device_put(new_smi->pdev); goto out_err; } new_smi->dev_registered = 1; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/