summaryrefslogtreecommitdiff
path: root/cpus.h
blob: 062672677d73b72319e93f546a8c70f3899c7ad4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef CPUS_H
#define CPUS_H

#include <unistd.h>
#include "built_in.h"
#include "die.h"

static inline unsigned int get_number_cpus(void)
{
	int ret = sysconf(_SC_NPROCESSORS_CONF);

	if (unlikely(ret <= 0))
		panic("get_number_cpus error!\n");

	return ret;
}

static inline unsigned int get_number_cpus_online(void)
{
	int ret = sysconf(_SC_NPROCESSORS_ONLN);

	if (unlikely(ret <= 0))
		panic("get_number_cpus_online error!\n");

	return ret;
}

#endif /* CPUS_H */
c08ac29df4c62ea5ccb01474b6597 (patch) treeb12c8a58d6a894f1fb8f2560c13abb26b1826489 parent2b985467371a58ae44d76c7ba12b0951fee6ed98 (diff)
usb: host: xhci: Fix possible wild pointer when handling abort command
When current command was supposed to be aborted, host will free the command in handle_cmd_completion() function. But it might be still referenced by xhci->current_cmd, which need to set NULL. Cc: <stable@vger.kernel.org> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat
-rw-r--r--drivers/usb/host/xhci-ring.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c