Merge 5.10.185 into android12-5.10-lts
Changes in 5.10.185 lib: cleanup kstrto*() usage kernel.h: split out kstrtox() and simple_strtox() to a separate header test_firmware: Use kstrtobool() instead of strtobool() test_firmware: prevent race conditions by a correct implementation of locking test_firmware: fix a memory leak with reqs buffer power: supply: ab8500: Fix external_power_changed race power: supply: sc27xx: Fix external_power_changed race power: supply: bq27xxx: Use mod_delayed_work() instead of cancel() + schedule() ARM: dts: vexpress: add missing cache properties tools: gpio: fix debounce_period_us output of lsgpio power: supply: Ratelimit no data debug output platform/x86: asus-wmi: Ignore WMI events with codes 0x7B, 0xC0 regulator: Fix error checking for debugfs_create_dir irqchip/gic-v3: Disable pseudo NMIs on Mediatek devices w/ firmware issues power: supply: Fix logic checking if system is running from battery btrfs: scrub: try harder to mark RAID56 block groups read-only btrfs: handle memory allocation failure in btrfs_csum_one_bio ASoC: soc-pcm: test if a BE can be prepared parisc: Improve cache flushing for PCXL in arch_sync_dma_for_cpu() parisc: Flush gatt writes and adjust gatt mask in parisc_agp_mask_memory() MIPS: Alchemy: fix dbdma2 mips: Move initrd_start check after initrd address sanitisation. ASoC: dwc: move DMA init to snd_soc_dai_driver probe() xen/blkfront: Only check REQ_FUA for writes drm:amd:amdgpu: Fix missing buffer object unlock in failure path irqchip/gic: Correctly validate OF quirk descriptors io_uring: hold uring mutex around poll removal epoll: ep_autoremove_wake_function should use list_del_init_careful ocfs2: fix use-after-free when unmounting read-only filesystem ocfs2: check new file size on fallocate call nios2: dts: Fix tse_mac "max-frame-size" property nilfs2: fix incomplete buffer cleanup in nilfs_btnode_abort_change_key() nilfs2: fix possible out-of-bounds segment allocation in resize ioctl kexec: support purgatories with .text.hot sections x86/purgatory: remove PGO flags powerpc/purgatory: remove PGO flags nouveau: fix client work fence deletion race RDMA/uverbs: Restrict usage of privileged QKEYs net: usb: qmi_wwan: add support for Compal RXM-G1 ALSA: hda/realtek: Add a quirk for Compaq N14JP6 Remove DECnet support from kernel USB: serial: option: add Quectel EM061KGL series serial: lantiq: add missing interrupt ack usb: dwc3: gadget: Reset num TRBs before giving back the request RDMA/rtrs: Fix the last iu->buf leak in err path spi: fsl-dspi: avoid SCK glitches with continuous transfers netfilter: nfnetlink: skip error delivery on batch in case of ENOMEM net: enetc: correct the indexes of highest and 2nd highest TCs ping6: Fix send to link-local addresses with VRF. net/sched: cls_u32: Fix reference counter leak leading to overflow RDMA/rxe: Remove the unused variable obj RDMA/rxe: Removed unused name from rxe_task struct RDMA/rxe: Fix the use-before-initialization error of resp_pkts iavf: remove mask from iavf_irq_enable_queues() octeontx2-af: fixed resource availability check RDMA/mlx5: Initiate dropless RQ for RAW Ethernet functions RDMA/cma: Always set static rate to 0 for RoCE IB/uverbs: Fix to consider event queue closing also upon non-blocking mode IB/isert: Fix dead lock in ib_isert IB/isert: Fix possible list corruption in CMA handler IB/isert: Fix incorrect release of isert connection ipvlan: fix bound dev checking for IPv6 l3s mode sctp: fix an error code in sctp_sf_eat_auth() igb: fix nvm.ops.read() error handling drm/nouveau: don't detect DSM for non-NVIDIA device drm/nouveau/dp: check for NULL nv_connector->native_mode drm/nouveau: add nv_encoder pointer check for NULL ext4: drop the call to ext4_error() from ext4_get_group_info() net/sched: cls_api: Fix lockup on flushing explicitly created chain net: lapbether: only support ethernet devices net: tipc: resize nlattr array to correct size selftests/ptp: Fix timestamp printf format for PTP_SYS_OFFSET afs: Fix vlserver probe RTT handling cgroup: always put cset in cgroup_css_set_put_fork rcu/kvfree: Avoid freeing new kfree_rcu() memory after old grace period neighbour: Remove unused inline function neigh_key_eq16() net: Remove unused inline function dst_hold_and_use() net: Remove DECnet leftovers from flow.h. neighbour: delete neigh_lookup_nodev as not used batman-adv: Switch to kstrtox.h for kstrtou64 mmc: block: ensure error propagation for non-blk mm/memory_hotplug: extend offline_and_remove_memory() to handle more than one memory block nilfs2: reject devices with insufficient block count media: dvbdev: Fix memleak in dvb_register_device media: dvbdev: fix error logic at dvb_register_device() media: dvb-core: Fix use-after-free due to race at dvb_register_device() drm/i915/dg1: Wait for pcode/uncore handshake at startup drm/i915/gen11+: Only load DRAM information from pcode um: Fix build w/o CONFIG_PM_SLEEP Linux 5.10.185 Change-Id: I05ba9c2e38c013c553c9f89e2a6b71ec9bdb0bd3 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/kstrtox.h>
|
||||
#include <linux/log2.h>
|
||||
#include <linux/minmax.h>
|
||||
#include <linux/typecheck.h>
|
||||
@@ -329,148 +330,6 @@ extern bool oops_may_print(void);
|
||||
void do_exit(long error_code) __noreturn;
|
||||
void complete_and_exit(struct completion *, long) __noreturn;
|
||||
|
||||
/* Internal, do not use. */
|
||||
int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res);
|
||||
int __must_check _kstrtol(const char *s, unsigned int base, long *res);
|
||||
|
||||
int __must_check kstrtoull(const char *s, unsigned int base, unsigned long long *res);
|
||||
int __must_check kstrtoll(const char *s, unsigned int base, long long *res);
|
||||
|
||||
/**
|
||||
* kstrtoul - convert a string to an unsigned long
|
||||
* @s: The start of the string. The string must be null-terminated, and may also
|
||||
* include a single newline before its terminating null. The first character
|
||||
* may also be a plus sign, but not a minus sign.
|
||||
* @base: The number base to use. The maximum supported base is 16. If base is
|
||||
* given as 0, then the base of the string is automatically detected with the
|
||||
* conventional semantics - If it begins with 0x the number will be parsed as a
|
||||
* hexadecimal (case insensitive), if it otherwise begins with 0, it will be
|
||||
* parsed as an octal number. Otherwise it will be parsed as a decimal.
|
||||
* @res: Where to write the result of the conversion on success.
|
||||
*
|
||||
* Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
|
||||
* Preferred over simple_strtoul(). Return code must be checked.
|
||||
*/
|
||||
static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res)
|
||||
{
|
||||
/*
|
||||
* We want to shortcut function call, but
|
||||
* __builtin_types_compatible_p(unsigned long, unsigned long long) = 0.
|
||||
*/
|
||||
if (sizeof(unsigned long) == sizeof(unsigned long long) &&
|
||||
__alignof__(unsigned long) == __alignof__(unsigned long long))
|
||||
return kstrtoull(s, base, (unsigned long long *)res);
|
||||
else
|
||||
return _kstrtoul(s, base, res);
|
||||
}
|
||||
|
||||
/**
|
||||
* kstrtol - convert a string to a long
|
||||
* @s: The start of the string. The string must be null-terminated, and may also
|
||||
* include a single newline before its terminating null. The first character
|
||||
* may also be a plus sign or a minus sign.
|
||||
* @base: The number base to use. The maximum supported base is 16. If base is
|
||||
* given as 0, then the base of the string is automatically detected with the
|
||||
* conventional semantics - If it begins with 0x the number will be parsed as a
|
||||
* hexadecimal (case insensitive), if it otherwise begins with 0, it will be
|
||||
* parsed as an octal number. Otherwise it will be parsed as a decimal.
|
||||
* @res: Where to write the result of the conversion on success.
|
||||
*
|
||||
* Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
|
||||
* Preferred over simple_strtol(). Return code must be checked.
|
||||
*/
|
||||
static inline int __must_check kstrtol(const char *s, unsigned int base, long *res)
|
||||
{
|
||||
/*
|
||||
* We want to shortcut function call, but
|
||||
* __builtin_types_compatible_p(long, long long) = 0.
|
||||
*/
|
||||
if (sizeof(long) == sizeof(long long) &&
|
||||
__alignof__(long) == __alignof__(long long))
|
||||
return kstrtoll(s, base, (long long *)res);
|
||||
else
|
||||
return _kstrtol(s, base, res);
|
||||
}
|
||||
|
||||
int __must_check kstrtouint(const char *s, unsigned int base, unsigned int *res);
|
||||
int __must_check kstrtoint(const char *s, unsigned int base, int *res);
|
||||
|
||||
static inline int __must_check kstrtou64(const char *s, unsigned int base, u64 *res)
|
||||
{
|
||||
return kstrtoull(s, base, res);
|
||||
}
|
||||
|
||||
static inline int __must_check kstrtos64(const char *s, unsigned int base, s64 *res)
|
||||
{
|
||||
return kstrtoll(s, base, res);
|
||||
}
|
||||
|
||||
static inline int __must_check kstrtou32(const char *s, unsigned int base, u32 *res)
|
||||
{
|
||||
return kstrtouint(s, base, res);
|
||||
}
|
||||
|
||||
static inline int __must_check kstrtos32(const char *s, unsigned int base, s32 *res)
|
||||
{
|
||||
return kstrtoint(s, base, res);
|
||||
}
|
||||
|
||||
int __must_check kstrtou16(const char *s, unsigned int base, u16 *res);
|
||||
int __must_check kstrtos16(const char *s, unsigned int base, s16 *res);
|
||||
int __must_check kstrtou8(const char *s, unsigned int base, u8 *res);
|
||||
int __must_check kstrtos8(const char *s, unsigned int base, s8 *res);
|
||||
int __must_check kstrtobool(const char *s, bool *res);
|
||||
|
||||
int __must_check kstrtoull_from_user(const char __user *s, size_t count, unsigned int base, unsigned long long *res);
|
||||
int __must_check kstrtoll_from_user(const char __user *s, size_t count, unsigned int base, long long *res);
|
||||
int __must_check kstrtoul_from_user(const char __user *s, size_t count, unsigned int base, unsigned long *res);
|
||||
int __must_check kstrtol_from_user(const char __user *s, size_t count, unsigned int base, long *res);
|
||||
int __must_check kstrtouint_from_user(const char __user *s, size_t count, unsigned int base, unsigned int *res);
|
||||
int __must_check kstrtoint_from_user(const char __user *s, size_t count, unsigned int base, int *res);
|
||||
int __must_check kstrtou16_from_user(const char __user *s, size_t count, unsigned int base, u16 *res);
|
||||
int __must_check kstrtos16_from_user(const char __user *s, size_t count, unsigned int base, s16 *res);
|
||||
int __must_check kstrtou8_from_user(const char __user *s, size_t count, unsigned int base, u8 *res);
|
||||
int __must_check kstrtos8_from_user(const char __user *s, size_t count, unsigned int base, s8 *res);
|
||||
int __must_check kstrtobool_from_user(const char __user *s, size_t count, bool *res);
|
||||
|
||||
static inline int __must_check kstrtou64_from_user(const char __user *s, size_t count, unsigned int base, u64 *res)
|
||||
{
|
||||
return kstrtoull_from_user(s, count, base, res);
|
||||
}
|
||||
|
||||
static inline int __must_check kstrtos64_from_user(const char __user *s, size_t count, unsigned int base, s64 *res)
|
||||
{
|
||||
return kstrtoll_from_user(s, count, base, res);
|
||||
}
|
||||
|
||||
static inline int __must_check kstrtou32_from_user(const char __user *s, size_t count, unsigned int base, u32 *res)
|
||||
{
|
||||
return kstrtouint_from_user(s, count, base, res);
|
||||
}
|
||||
|
||||
static inline int __must_check kstrtos32_from_user(const char __user *s, size_t count, unsigned int base, s32 *res)
|
||||
{
|
||||
return kstrtoint_from_user(s, count, base, res);
|
||||
}
|
||||
|
||||
/*
|
||||
* Use kstrto<foo> instead.
|
||||
*
|
||||
* NOTE: simple_strto<foo> does not check for the range overflow and,
|
||||
* depending on the input, may give interesting results.
|
||||
*
|
||||
* Use these functions if and only if you cannot use kstrto<foo>, because
|
||||
* the conversion ends on the first non-digit character, which may be far
|
||||
* beyond the supported range. It might be useful to parse the strings like
|
||||
* 10x50 or 12:21 without altering original string or temporary buffer in use.
|
||||
* Keep in mind above caveat.
|
||||
*/
|
||||
|
||||
extern unsigned long simple_strtoul(const char *,char **,unsigned int);
|
||||
extern long simple_strtol(const char *,char **,unsigned int);
|
||||
extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
|
||||
extern long long simple_strtoll(const char *,char **,unsigned int);
|
||||
|
||||
extern int num_to_str(char *buf, int size,
|
||||
unsigned long long num, unsigned int width);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user