From patchwork Wed Jun 29 21:52:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Khoroshilov X-Patchwork-Id: 9206377 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 388EB6075F for ; Thu, 30 Jun 2016 00:34:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 276E7284CE for ; Thu, 30 Jun 2016 00:34:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C0832863A; Thu, 30 Jun 2016 00:34:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61C6A284CE for ; Thu, 30 Jun 2016 00:34:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C1CE86E7B3; Thu, 30 Jun 2016 00:34:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 569 seconds by postgrey-1.35 at gabe; Wed, 29 Jun 2016 22:00:02 UTC Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.45]) by gabe.freedesktop.org (Postfix) with ESMTP id 4363C6E629 for ; Wed, 29 Jun 2016 22:00:02 +0000 (UTC) Received: from localhost.localdomain (unknown [85.140.183.203]) by mail.ispras.ru (Postfix) with ESMTPSA id 4BCEF54006D; Thu, 30 Jun 2016 00:50:32 +0300 (MSK) From: Alexey Khoroshilov To: David Airlie Subject: [PATCH] drm_aux-dev: fix error handling in drm_dp_aux_dev_init() Date: Thu, 30 Jun 2016 00:52:15 +0300 Message-Id: <1467237135-13075-1-git-send-email-khoroshilov@ispras.ru> X-Mailer: git-send-email 1.9.1 X-Mailman-Approved-At: Thu, 30 Jun 2016 00:34:03 +0000 Cc: ldv-project@linuxtesting.org, dri-devel@lists.freedesktop.org, Alexey Khoroshilov , linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP If class_create() fails, there is no need for class_destroy(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/gpu/drm/drm_dp_aux_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_aux_dev.c b/drivers/gpu/drm/drm_dp_aux_dev.c index 3334baacf43d..734f86a345f6 100644 --- a/drivers/gpu/drm/drm_dp_aux_dev.c +++ b/drivers/gpu/drm/drm_dp_aux_dev.c @@ -355,8 +355,7 @@ int drm_dp_aux_dev_init(void) drm_dp_aux_dev_class = class_create(THIS_MODULE, "drm_dp_aux_dev"); if (IS_ERR(drm_dp_aux_dev_class)) { - res = PTR_ERR(drm_dp_aux_dev_class); - goto out; + return PTR_ERR(drm_dp_aux_dev_class); } drm_dp_aux_dev_class->dev_groups = drm_dp_aux_groups;