mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* fs/smb/server/connection.c:42:5-24: WARNING: atomic_dec_and_test variation before object free at line 43.
@ 2025-06-28 11:20 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-06-28 11:20 UTC (permalink / raw)
  To: Namjae Jeon; +Cc: oe-kbuild-all, linux-kernel, Steve French

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   aaf724ed69264719550ec4f194d3ab17b886af9a
commit: ee426bfb9d09b29987369b897fe9b6485ac2be27 ksmbd: add refcnt to ksmbd_conn struct
date:   10 months ago
config: i386-randconfig-052-20250628 (https://download.01.org/0day-ci/archive/20250628/202506281916.wVorCT8Y-lkp@intel.com/config)
compiler: clang version 20.1.7 (https://github.com/llvm/llvm-project 6146a88f60492b520a36f8f8f3231e15f3cc6082)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506281916.wVorCT8Y-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/smb/server/connection.c:42:5-24: WARNING: atomic_dec_and_test variation before object free at line 43.

vim +42 fs/smb/server/connection.c

    24	
    25	/**
    26	 * ksmbd_conn_free() - free resources of the connection instance
    27	 *
    28	 * @conn:	connection instance to be cleand up
    29	 *
    30	 * During the thread termination, the corresponding conn instance
    31	 * resources(sock/memory) are released and finally the conn object is freed.
    32	 */
    33	void ksmbd_conn_free(struct ksmbd_conn *conn)
    34	{
    35		down_write(&conn_list_lock);
    36		list_del(&conn->conns_list);
    37		up_write(&conn_list_lock);
    38	
    39		xa_destroy(&conn->sessions);
    40		kvfree(conn->request_buf);
    41		kfree(conn->preauth_info);
  > 42		if (atomic_dec_and_test(&conn->refcnt))
  > 43			kfree(conn);
    44	}
    45	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-06-28 11:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-28 11:20 fs/smb/server/connection.c:42:5-24: WARNING: atomic_dec_and_test variation before object free at line 43 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®