lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fc1ba609-93d6-4508-b6ac-bba9471cb075@kadam.mountain>
Date:   Thu, 2 Nov 2023 17:31:12 +0300
From:   Dan Carpenter <dan.carpenter@...aro.org>
To:     Alexandra Diupina <adiupina@...ralinux.ru>
Cc:     Hans de Goede <hdegoede@...hat.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Andy Shevchenko <andy@...nel.org>,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>, linux-media@...r.kernel.org,
        linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
        lvc-project@...uxtesting.org
Subject: Re: [PATCH 1/4] Remove redundant return value check

On Thu, Nov 02, 2023 at 05:11:32PM +0300, Alexandra Diupina wrote:
> media_entity_pads_init() will not return 0 only if the
> 2nd parameter >= MEDIA_ENTITY_MAX_PADS (512), but 1 is
> passed, so checking the return value is redundant
> 

It can return an error because of this check:

drivers/media/mc/mc-entity.c
   215                  if (hweight32(iter->flags & (MEDIA_PAD_FL_SINK |
   216                                               MEDIA_PAD_FL_SOURCE)) != 1) {
   217                          ret = -EINVAL;
   218                          break;
   219                  }

Plus I don't like removing error checking for this reason.

Earlier this month I fixed a case where someone removed an IS_ERR()
check but then we modified the function to return error pointers.
https://lore.kernel.org/all/356fb42c-9cf1-45cd-9233-ac845c507fb7@moroto.mountain/

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ