All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/net/ethernet/marvell/prestera/prestera_span.c:95 prestera_span_get() warn: passing a valid pointer to 'PTR_ERR'
Date: Fri, 28 Jan 2022 03:18:36 +0800	[thread overview]
Message-ID: <202201280334.fPJzomiw-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3130 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Serhiy Boiko <serhiy.boiko@plvision.eu>
CC: Volodymyr Mytnyk <vmytnyk@marvell.com>
CC: Vadym Kochan <vkochan@marvell.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   626b2dda7651a7c766108db4cdc0825db05b980d
commit: 13defa275eef90c07886dbd9e74e3dada8af7348 net: marvell: prestera: Add matchall support
date:   8 months ago
:::::: branch date: 10 hours ago
:::::: commit date: 8 months ago
config: microblaze-randconfig-m031-20220127 (https://download.01.org/0day-ci/archive/20220128/202201280334.fPJzomiw-lkp(a)intel.com/config)
compiler: microblaze-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/net/ethernet/marvell/prestera/prestera_span.c:95 prestera_span_get() warn: passing a valid pointer to 'PTR_ERR'

vim +/PTR_ERR +95 drivers/net/ethernet/marvell/prestera/prestera_span.c

13defa275eef90 Serhiy Boiko 2021-06-16   73  
13defa275eef90 Serhiy Boiko 2021-06-16   74  static int prestera_span_get(struct prestera_port *port, u8 *span_id)
13defa275eef90 Serhiy Boiko 2021-06-16   75  {
13defa275eef90 Serhiy Boiko 2021-06-16   76  	u8 new_span_id;
13defa275eef90 Serhiy Boiko 2021-06-16   77  	struct prestera_switch *sw = port->sw;
13defa275eef90 Serhiy Boiko 2021-06-16   78  	struct prestera_span_entry *entry;
13defa275eef90 Serhiy Boiko 2021-06-16   79  	int err;
13defa275eef90 Serhiy Boiko 2021-06-16   80  
13defa275eef90 Serhiy Boiko 2021-06-16   81  	entry = prestera_span_entry_find_by_port(sw->span, port);
13defa275eef90 Serhiy Boiko 2021-06-16   82  	if (entry) {
13defa275eef90 Serhiy Boiko 2021-06-16   83  		refcount_inc(&entry->ref_count);
13defa275eef90 Serhiy Boiko 2021-06-16   84  		*span_id = entry->id;
13defa275eef90 Serhiy Boiko 2021-06-16   85  		return 0;
13defa275eef90 Serhiy Boiko 2021-06-16   86  	}
13defa275eef90 Serhiy Boiko 2021-06-16   87  
13defa275eef90 Serhiy Boiko 2021-06-16   88  	err = prestera_hw_span_get(port, &new_span_id);
13defa275eef90 Serhiy Boiko 2021-06-16   89  	if (err)
13defa275eef90 Serhiy Boiko 2021-06-16   90  		return err;
13defa275eef90 Serhiy Boiko 2021-06-16   91  
13defa275eef90 Serhiy Boiko 2021-06-16   92  	entry = prestera_span_entry_create(port, new_span_id);
13defa275eef90 Serhiy Boiko 2021-06-16   93  	if (IS_ERR(entry)) {
13defa275eef90 Serhiy Boiko 2021-06-16   94  		prestera_hw_span_release(sw, new_span_id);
13defa275eef90 Serhiy Boiko 2021-06-16  @95  		return PTR_ERR(entry);
13defa275eef90 Serhiy Boiko 2021-06-16   96  	}
13defa275eef90 Serhiy Boiko 2021-06-16   97  
13defa275eef90 Serhiy Boiko 2021-06-16   98  	*span_id = new_span_id;
13defa275eef90 Serhiy Boiko 2021-06-16   99  	return 0;
13defa275eef90 Serhiy Boiko 2021-06-16  100  }
13defa275eef90 Serhiy Boiko 2021-06-16  101  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

             reply	other threads:[~2022-01-27 19:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 19:18 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-02-01  7:11 drivers/net/ethernet/marvell/prestera/prestera_span.c:95 prestera_span_get() warn: passing a valid pointer to 'PTR_ERR' kernel test robot
2021-11-17 16:49 kernel test robot
2021-11-16  0:08 kernel test robot
2021-11-08  6:13 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202201280334.fPJzomiw-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.