Skip to contentSkip to conversation

fs/io_uring.c:3728 io_poll_double_wake() error: uninitialized symbol 'ret'.

PATCH New Dan Carpenter 1 participant 1 message Feb 11, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1282/1397 fs/io_uring.c:3728 io_poll_double_wake() error: uninitialized symbol 'ret'.

tree:   https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git__;!!GqivPVa7Brio!PGWMsjXmbbqZt_LPI1Vj4bMZj_O4vT5eESYZSXkbyGnBfwvTLA-a3S3cFPn9LN8IxQ$  master
head:   ac431e2d7b1be81bfe58163b9f81ba79bc987dc3
commit: 2b10058375d18e69d14955888fd55591cc553582 [1282/1397] io_uring: allow POLL_ADD with double poll_wait() users

If you fix the issue, kindly add following tag

New smatch warnings:
fs/io_uring.c:3728 io_poll_double_wake() error: uninitialized symbol 'ret'.

Old smatch warnings:
fs/io_uring.c:2191 io_setup_async_rw() error: we previously assumed 'req->io' could be null (see line 2187) fs/io_uring.c:5949 __io_sqe_files_update() error: uninitialized symbol 'err'.

# https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=2b10058375d18e69d14955888fd55591cc553582__;!!GqivPVa7Brio!PGWMsjXmbbqZt_LPI1Vj4bMZj_O4vT5eESYZSXkbyGnBfwvTLA-a3S3cFPnHp1qyaA$
git remote add linux-next https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git__;!!GqivPVa7Brio!PGWMsjXmbbqZt_LPI1Vj4bMZj_O4vT5eESYZSXkbyGnBfwvTLA-a3S3cFPn9LN8IxQ$
git remote update linux-next
git checkout 2b10058375d18e69d14955888fd55591cc553582
vim +/ret +3728 fs/io_uring.c

2b10058375d18e Jens Axboe 2020-02-10  3703  static int io_poll_double_wake(struct wait_queue_entry *wait, unsigned mode,
2b10058375d18e Jens Axboe 2020-02-10  3704  			       int sync, void *key)
2b10058375d18e Jens Axboe 2020-02-10  3705  {
2b10058375d18e Jens Axboe 2020-02-10  3706  	struct io_kiocb *req = wait->private;
2b10058375d18e Jens Axboe 2020-02-10  3707  	struct io_poll_iocb *poll = (void *) req->io;
2b10058375d18e Jens Axboe 2020-02-10  3708  	__poll_t mask = key_to_poll(key);
2b10058375d18e Jens Axboe 2020-02-10  3709  	bool done = true;
2b10058375d18e Jens Axboe 2020-02-10  3710  	int ret;
2b10058375d18e Jens Axboe 2020-02-10  3711  
2b10058375d18e Jens Axboe 2020-02-10  3712  	/* for instances that support it check for an event match first: */
2b10058375d18e Jens Axboe 2020-02-10  3713  	if (mask && !(mask & poll->events))
2b10058375d18e Jens Axboe 2020-02-10  3714  		return 0;
2b10058375d18e Jens Axboe 2020-02-10  3715  
2b10058375d18e Jens Axboe 2020-02-10  3716  	if (req->poll.head) {
2b10058375d18e Jens Axboe 2020-02-10  3717  		unsigned long flags;
2b10058375d18e Jens Axboe 2020-02-10  3718  
2b10058375d18e Jens Axboe 2020-02-10  3719  		spin_lock_irqsave(&req->poll.head->lock, flags);
2b10058375d18e Jens Axboe 2020-02-10  3720  		done = list_empty(&req->poll.wait.entry);
2b10058375d18e Jens Axboe 2020-02-10  3721  		if (!done)
2b10058375d18e Jens Axboe 2020-02-10  3722  			list_del_init(&req->poll.wait.entry);
2b10058375d18e Jens Axboe 2020-02-10  3723  		spin_unlock_irqrestore(&req->poll.head->lock, flags);
2b10058375d18e Jens Axboe 2020-02-10  3724  	}
2b10058375d18e Jens Axboe 2020-02-10  3725  	if (!done)
2b10058375d18e Jens Axboe 2020-02-10  3726  		__io_poll_wake(req, poll, mask);
2b10058375d18e Jens Axboe 2020-02-10  3727  	refcount_dec(&req->refs);

2b10058375d18e Jens Axboe 2020-02-10 @3728 return ret;

return 0;

2b10058375d18e Jens Axboe 2020-02-10 3729 }
2b10058375d18e Jens Axboe 2020-02-10 3730

---
0-DAY CI Kernel Test Service, Intel Corporation
https://urldefense.com/v3/__https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org__;!!GqivPVa7Brio!PGWMsjXmbbqZt_LPI1Vj4bMZj_O4vT5eESYZSXkbyGnBfwvTLA-a3S3cFPn5mEgCTQ$