From patchwork Sun Jun 19 12:31:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Krause X-Patchwork-Id: 9186119 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 830AC601C0 for ; Sun, 19 Jun 2016 12:32:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7291428211 for ; Sun, 19 Jun 2016 12:32:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66D2F2823B; Sun, 19 Jun 2016 12:32:14 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8FBD28211 for ; Sun, 19 Jun 2016 12:32:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751816AbcFSMcA (ORCPT ); Sun, 19 Jun 2016 08:32:00 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33911 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751747AbcFSMb4 (ORCPT ); Sun, 19 Jun 2016 08:31:56 -0400 Received: by mail-wm0-f65.google.com with SMTP id 187so7875208wmz.1 for ; Sun, 19 Jun 2016 05:31:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=28WjSPBJfV6faFFi1FKsvr+g5cKEcdLXJTc8ko9OaCM=; b=V0wZ4x6rv0v/t+VOKmB62rpl5S08Yd/ytEDtafSEkV3qjuySMgr4vSIv9+tTOLjrS/ vPiqLX/HRoeOAKyX/p7HTyrQsDjn0JidWv0r18HpDVRNN82ULj4WWUb0j0nq6N3+mlqq tNwcpKbXuz+zr1nUOjRCv/wMjHTSbdhFOk6bIWvtRwrLoZ2l8bzycfJ+i+Ay0nXPQKV3 cdwWqc6/wEMgVpud1gq1WtH7WR4Fk3hWcuX9FomvDLIpcT2aRRDKLSauTch0fTj86lVw QQkfdfgeD0953kWtJc6H0FxZsKSWIiUjoJ8tJrHdA6TBbUgSMuP7RUurnPvb9fxz8ovd fP+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=28WjSPBJfV6faFFi1FKsvr+g5cKEcdLXJTc8ko9OaCM=; b=XwsYI/sLOqIu0jLaRHpguXuFsRZ4FwHaOGc36BrowZUpPJCjFHTICEcA8g9KYbWkSE ZVvfG/+r3nW6HL4v/zGsq9Aj6Mfvn91PBteQBD6vt5qVdZf5TZgeb8L/3nbDL7MK/BXJ eUrF79D1MX7ze16N4dyEnkDMLQaGZ64t1WjugsNW5+E0k8uV+dgiAjIB6j7JAXypMVZT sUaTYLIQSzD8Y4jQetsYqmwvD7aM+XyKuHWPHwNKvjEk2Y5WguPt7yz2+GjSZrC/JD0h zx/oFd6cBQBC7JzBOYi9lg1/W0ogN0DhY6LjvZdiSMqMEnZl2JvtEzpbcuQIq8E9/Fgn 8mSA== X-Gm-Message-State: ALyK8tJBr4EYaRnHHo6PNp97aMhkzyUnZhzGYnzBBAEITCrh7u6klQcT3GKxeM7z8S+QyQ== X-Received: by 10.28.103.2 with SMTP id b2mr6808538wmc.28.1466339514711; Sun, 19 Jun 2016 05:31:54 -0700 (PDT) Received: from jig.fritz.box ([84.179.22.43]) by smtp.gmail.com with ESMTPSA id g3sm58348678wjb.47.2016.06.19.05.31.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Jun 2016 05:31:54 -0700 (PDT) From: Mathias Krause To: Sumit Semwal Cc: Brad Spengler , PaX Team , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, Mathias Krause , Daniel Vetter Subject: [PATCH 2/3] dma-buf: remove dma_buf directory on bufinfo file creation errors Date: Sun, 19 Jun 2016 14:31:30 +0200 Message-Id: <1466339491-12639-3-git-send-email-minipli@googlemail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1466339491-12639-1-git-send-email-minipli@googlemail.com> References: <1466339491-12639-1-git-send-email-minipli@googlemail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Change the error handling in dma_buf_init_debugfs() to remove the "dma_buf" directory if creating the "bufinfo" file fails. No need to have an empty debugfs directory around. Signed-off-by: Mathias Krause Cc: Sumit Semwal Cc: Daniel Vetter --- drivers/dma-buf/dma-buf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 7094b19bb495..f03e51561199 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -907,8 +907,11 @@ static int dma_buf_init_debugfs(void) err = dma_buf_debugfs_create_file("bufinfo", NULL); - if (err) + if (err) { pr_debug("dma_buf: debugfs: failed to create node bufinfo\n"); + debugfs_remove_recursive(dma_buf_debugfs_dir); + dma_buf_debugfs_dir = NULL; + } return err; }