From patchwork Wed Jun 12 14:50:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10990185 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E33B71395 for ; Wed, 12 Jun 2019 14:50:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1566286AA for ; Wed, 12 Jun 2019 14:50:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C605D20502; Wed, 12 Jun 2019 14:50:38 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 76D6120502 for ; Wed, 12 Jun 2019 14:50:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437021AbfFLOuh (ORCPT ); Wed, 12 Jun 2019 10:50:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:57916 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436952AbfFLOuh (ORCPT ); Wed, 12 Jun 2019 10:50:37 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1F488206BB; Wed, 12 Jun 2019 14:50:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560351036; bh=rTbyq5MmyIh2UQAp0E6ynXYPmdgyNJkcG0/LtgC2t/o=; h=Date:From:To:Cc:Subject:From; b=CAMND5IBjqjHNvOr7moy6UJyUD4K+mD5A2K/3+FFoimbibtGPsGG0wLiGk8fhL0u2 vZXpmzd9HNkDn889jfbMfxE9aKcS2nEnLXyqIRWOgcwg4PJGwURMesR294I/zL3AWC QqPeCcd5XUYRPIGTS81ItblG7zH7EOjO7oiLrXy4= Date: Wed, 12 Jun 2019 16:50:33 +0200 From: Greg Kroah-Hartman To: Paolo Bonzini , Radim =?utf-8?b?S3LEjW3DocWZ?= Cc: kvm@vger.kernel.org Subject: [PATCH] kvm: remove invalid check for debugfs_create_dir() Message-ID: <20190612145033.GA18084@kroah.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.12.0 (2019-05-25) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP debugfs_create_dir() can never return NULL, so no need to check for an impossible thing. It's also not needed to ever check the return value of this function, so just remove the check entirely, and indent the previous line to a sane formatting :) Cc: Paolo Bonzini Cc: "Radim Krčmář" Cc: kvm@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- virt/kvm/kvm_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index ca54b09adf5b..4b4ef642d8fa 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2605,9 +2605,7 @@ static int kvm_create_vcpu_debugfs(struct kvm_vcpu *vcpu) snprintf(dir_name, sizeof(dir_name), "vcpu%d", vcpu->vcpu_id); vcpu->debugfs_dentry = debugfs_create_dir(dir_name, - vcpu->kvm->debugfs_dentry); - if (!vcpu->debugfs_dentry) - return -ENOMEM; + vcpu->kvm->debugfs_dentry); ret = kvm_arch_create_vcpu_debugfs(vcpu); if (ret < 0) {