Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1274323pxb; Thu, 24 Mar 2022 16:39:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1F7KUfDmhgu4O+KayxC5ExsSAIqBRYjrwuTO4Jy6ljLHAryHt6CVjiyicxmk19ZFVbzQz X-Received: by 2002:a63:e845:0:b0:385:f512:acbd with SMTP id a5-20020a63e845000000b00385f512acbdmr5872254pgk.196.1648165140134; Thu, 24 Mar 2022 16:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648165140; cv=none; d=google.com; s=arc-20160816; b=fQCZBODVtnATHbbe2Y02D9qKqxJ58THk1zj45gfygLx8U7GNxWohchu90E0fSBZ+Yt OtuWR6Ig0GNNR50y7RXC+yS1vjAa1JbwUdx+xsMRsz1DvtGlipqO958DRYpcUdv4VcnR 0y39zS7tBCtl6qXNKVlKgIPoRlPRfKkNueytvGH95Vk0itAsFDR/TQ+f/377FUrRZhr6 zbiUJLR8c6cJcdi52G/Feh3cqmQ0Tle0bSGyKIHyLalovTavZFIGUwNLZgdHxOxIDaNz KrgQ+GJ4KcKRo/KzcaDSKhKrXodaiCQ1acMGPAMYuwUbZ+GQcqdE20EcEBq+uJmSvLu0 FTJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wUxU3fOD5HvLRSIgRUZrOG93Jscp2CK4Bk5FgxkJpUs=; b=ooDt0CXDvHnROcL8kflmjo12G5mJrpK4agrU7nQQ1Ekjwzk3WLWvV2/ViZqHG8hGhK Ufg0QfLE05t/9xSoRMWHd5j5XA/TZqey/Z4wiSJXHUqVd0ZgImVpbeY5U38pxUhO0fBe 5PuVvw/jqu8DV8NEZVBHjJud5yw9G85QUlM/r0x5yK+YuU/Yw6kZWhQ1wHXHECEhuq+6 qUKLUsZwpw75ztHaUVBf3uvZfOm1hxJWbMGswvd7LTBWtH+pkl0OTsQ5RznYQLjk1Hbe iWSFxAVA8oKqJ67Eyg/2qI4NrF5lvauDoTgVyd70X1UPASCfcf840DQspXnyadv7hrj1 eTPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=I0f7XIFU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b8-20020a63d808000000b003816043f02csi680614pgh.545.2022.03.24.16.38.46; Thu, 24 Mar 2022 16:39:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=I0f7XIFU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349171AbiCXJVz (ORCPT + 99 others); Thu, 24 Mar 2022 05:21:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237756AbiCXJVx (ORCPT ); Thu, 24 Mar 2022 05:21:53 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA3545A592 for ; Thu, 24 Mar 2022 02:20:20 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id x34so4852967ede.8 for ; Thu, 24 Mar 2022 02:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wUxU3fOD5HvLRSIgRUZrOG93Jscp2CK4Bk5FgxkJpUs=; b=I0f7XIFUmiIz6T697ESW/6vQEHTCQR/9iqVii1Nu5YP2M/w1xM8JFezUeoDTA3NS94 wm+3sKh20V8YgFadenrWLm2evSLbF6u6oi5/2eLfCRQI3ixaJDsvn6FmISO1sp+nl/gg 0qPd4JuOfjA3UZsvBQWsqTd4Z1Rv2946U24xNHJRl8oM8FLnpp7k4x9f7VS78tpOH//8 pXgio5iQRHjZdZkJqQbPJN4tscUgS9yXepEC57kLQWK8cfnrhVHCpvLtvER6JHdwC0i6 nVlQDXvL9NNapHXnNp1UiNzQLYcK7ARo/xgQuNX/UCc088UgdvAO2KHlXnIvPrso2UGJ kQow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wUxU3fOD5HvLRSIgRUZrOG93Jscp2CK4Bk5FgxkJpUs=; b=FjtM1I4lI0AF3LWfeaT6yri+IUU4aVl+TD9pWW8g4/5gGmoTvz3YTCfYR+SqdcNnNp no8kbeHaCiq3kEAQKC8Kdho5Hag4ZnSmNgx6wApguMLA9COjFCIUBhizEATeKABPxKws cEo0qfjMf1NB7myTcZ1+UHkYClXoy+kdJ/MZfQ+NgohXl+c7qBiXttRw/0JPbV0jUaD9 7jcbwrGDwznLpaogEdH6JP7x9xVkQQLJcTzBf5mZujsKbDKZO7Zu9Lvs4rTOVTDNQ9qP 2oYvcLzWlNiEXFRw/NPmFTErU24tu3ACLDjcskxYW2eP4ssobWMyn+Cfqi1UoSCBQWCy MTww== X-Gm-Message-State: AOAM531jloTF34TVXSN0VChRpfsaZEv+IaXTyTyNCDD8m9CP0XMcgwF8 kNI4N7531sAU5pwl6J5+8V8Unpe9EJQ= X-Received: by 2002:a50:99cd:0:b0:418:d6c2:2405 with SMTP id n13-20020a5099cd000000b00418d6c22405mr5469314edb.342.1648113619282; Thu, 24 Mar 2022 02:20:19 -0700 (PDT) Received: from leap.localnet (host-95-249-145-232.retail.telecomitalia.it. [95.249.145.232]) by smtp.gmail.com with ESMTPSA id da19-20020a056402177300b00413583e0996sm1125552edb.14.2022.03.24.02.20.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 02:20:17 -0700 (PDT) From: "Fabio M. De Francesco" To: Greg Kroah-Hartman Cc: David Kershner , sparmaintainer@unisys.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: unisys: Properly test debugfs_create_dir() return values Date: Thu, 24 Mar 2022 10:20:15 +0100 Message-ID: <3480204.R56niFO833@leap> In-Reply-To: References: <20220322083858.16887-1-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On marted? 22 marzo 2022 09:47:29 CET Greg Kroah-Hartman wrote: > On Tue, Mar 22, 2022 at 09:38:58AM +0100, Fabio M. De Francesco wrote: > > debugfs_create_dir() returns a pointers to a dentry objects. On failures > > it returns errors. Currently the values returned to visornic_probe() > > seem to be tested for being equal to NULL in case of failures. > > > > Properly test with "if (IS_ERR())" and then assign the correct error > > value to the "err" variable. > > > > Signed-off-by: Fabio M. De Francesco > > --- > > drivers/staging/unisys/visornic/visornic_main.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c > > index 643432458105..58d03f3d3173 100644 > > --- a/drivers/staging/unisys/visornic/visornic_main.c > > +++ b/drivers/staging/unisys/visornic/visornic_main.c > > @@ -1922,11 +1922,11 @@ static int visornic_probe(struct visor_device *dev) > > /* create debug/sysfs directories */ > > devdata->eth_debugfs_dir = debugfs_create_dir(netdev->name, > > visornic_debugfs_dir); > > - if (!devdata->eth_debugfs_dir) { > > + if (IS_ERR(devdata->eth_debugfs_dir)) { > > We really shouldn't be checking this value at all. There's no reason to > check the return value of a debugfs_* call. Can you fix up the code to > do that instead? > > thanks, > > greg k-h > Yes I'll do the work that you requested by this weekend, notwithstanding what I replied to Dan. While I reiterate all my considerations, it seems that, if not the people from Unisys, someone else still cares about this driver :) Thanks, Fabio