From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3188BC0015E for ; Wed, 12 Jul 2023 16:35:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231721AbjGLQfT (ORCPT ); Wed, 12 Jul 2023 12:35:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231537AbjGLQfQ (ORCPT ); Wed, 12 Jul 2023 12:35:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B361E1711 for ; Wed, 12 Jul 2023 09:35:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 485B86183B for ; Wed, 12 Jul 2023 16:35:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B854C433CA; Wed, 12 Jul 2023 16:35:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689179712; bh=lEOMrk2R8PBpUbiIy/xxH/SlLLTYsrBU5sRxDqjf7rA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vZaB37I0s4Q0o7G57kLJC9B0sVkua69J9BzJ24Pi09bG0toae+Uzc47t3PcSWGXTh vqgfRjZIaxOQyR0hnO+TKpNLRtPU3EHNCMfdx2wkTIhaCTkSQAiPGv4j7TaA18cP1S cOvjtQtMrodIsiO5Q1TyAB+9hfAXRgrquUu8hDew= Date: Wed, 12 Jul 2023 18:35:10 +0200 From: Greg Kroah-Hartman To: Wang Ming Cc: Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Carlos Llamas , Suren Baghdasaryan , linux-kernel@vger.kernel.org, opensource.kernel@vivo.com Subject: Re: [PATCH v1] android:Fix error checking for debugfs_create_dir() in binder_init() Message-ID: <2023071257-patronize-unfeeling-cbe5@gregkh> References: <20230712133920.9509-1-machel@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230712133920.9509-1-machel@vivo.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 12, 2023 at 09:39:07PM +0800, Wang Ming wrote: > debugfs_create_dir() does not return NULL,but it is > possible to return error pointer. Most incorrect error checks > were fixed,but the one in binder_init() was forgotten. > > Fix the remaining error check. > > Signed-off-by: Wang Ming > --- > drivers/android/binder.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/android/binder.c b/drivers/android/binder.c > index 486c8271cab7..3b5309484df6 100644 > --- a/drivers/android/binder.c > +++ b/drivers/android/binder.c > @@ -6566,7 +6566,7 @@ static int __init binder_init(void) > atomic_set(&binder_transaction_log_failed.cur, ~0U); > > binder_debugfs_dir_entry_root = debugfs_create_dir("binder", NULL); > - if (binder_debugfs_dir_entry_root) { > + if (!IS_ERR(binder_debugfs_dir_entry_root)) { Again, no need to check this at all. thanks, greg k-h