All of lore.kernel.org
 help / color / mirror / Atom feed
* Potential bug in queue_count_set
@ 2019-04-10 13:33 Maximilian Luz
  2019-04-10 14:11 ` Minwoo Im
  0 siblings, 1 reply; 6+ messages in thread
From: Maximilian Luz @ 2019-04-10 13:33 UTC (permalink / raw)


Hi all,

I just stumbled (more or less randomly) over this piece of code
(/drivers/nvme/host/pci.c, v5.1-rc4):

147: static int queue_count_set(const char *val, const struct kernel_param *kp)
148: {
149: 	int n = 0, ret;
150:
151: 	ret = kstrtoint(val, 10, &n);
152: 	if (ret)
153: 		return ret;
154: 	if (n > num_possible_cpus())
155: 		n = num_possible_cpus();
156:
157: 	return param_set_int(val, kp);
158: }

Link with context: https://github.com/torvalds/linux/blob/v5.1-rc4/drivers/nvme/host/pci.c#L154-L155

It looks like lines 154, 155 don't achieve anything as `n` is not being
used afterwards. Sorry if this is already known or a non-issue, just
wanted to let you guys know.

Maximilian

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-04-12 20:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-10 13:33 Potential bug in queue_count_set Maximilian Luz
2019-04-10 14:11 ` Minwoo Im
2019-04-11 16:02   ` Minwoo Im
2019-04-11 17:39     ` Maximilian Luz
2019-04-11 21:15       ` Minwoo Im
2019-04-12 20:59         ` Maximilian Luz

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.