From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751242AbdGPG6g (ORCPT ); Sun, 16 Jul 2017 02:58:36 -0400 Received: from smtp10.smtpout.orange.fr ([80.12.242.132]:55417 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751010AbdGPG6e (ORCPT ); Sun, 16 Jul 2017 02:58:34 -0400 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 16 Jul 2017 08:58:32 +0200 X-ME-IP: 92.140.226.29 From: Christophe JAILLET To: rui.zhang@intel.com, edubezval@gmail.com Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 0/3] thermal: core: Fix some error handling code in 'thermal_zone_device_register()' Date: Sun, 16 Jul 2017 08:58:19 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These 3 patches are all related to error handling in 'thermal_zone_device_register()'. I've splitted them in 3 because each fixes or cleans something different. They could also be merged together because they are all related to the same few lines of code. The 1st one fixes in memory leak. The 2nd reorders code in the error handling path to have it more logical. The 3rd simplifies the code. Not 100% sure, but the 2nd one could also avoid an OOPS because we try to unregister something that has never been registered. Christophe JAILLET (3): thermal: core: Fix a memory leak in 'thermal_zone_device_register()' error handling path thermal: core: Reorder 'thermal_zone_device_register()' error handling code thermal: core: Avoid code duplication in 'thermal_zone_device_register()' drivers/thermal/thermal_core.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) -- 2.11.0