mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
This is the 4.19.137 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl8qaHIACgkQONu9yGCS aT62TxAAwZ04yMUrjhm9TpAYUGJXcZ77AL2fliW4Ep8VRE1umCoKhmp8kB6JV5TD U/hxqufydvFbuRJK0hmrPhRPCkQfsTD6xKITjq1JgvEz5abGbrPXi7VZtJPQaiUN LxcNLwYfe2j8cRMWOpPQ10V/HvFpvlyrGF5TYpCT/5h1Y48FdBFTywNzmbL/J55O v7LMDgg2KB5SMPVsVktThWR5nsATiWBmJWb+4d0+GNkRX0idhu+XIKkNVWW8GAQa zjaUP9E7ysNU+YBwgD6uaRu0sgIxxqi9eITqqk+46b4gy1S/n5iorIkddkMoaySN ttLOiZZal9TDs1CTXXCPrw/14b+go9irEpwtYXGMdkmtOV28022m6YF7IkYHpX4I IsEPfLRlulB0i8DddNguOhHKVkD6Kuf934+sYV447QyqlPSszaGGxh+EK+aOk4/4 PdwvUJlS90ExND0ID4whMgl50MOf6YcQxZ2oykDyNeVqU8USwdo0c6tYatNvdiu9 DRzV6AU9CwnA0rYpCSpXY89j1uWeJCgKvYH3rTBIqUPKWT3LMfshu8xJioxP+29R eooKvy3I5miPv47s9cQKw+5dae0kH/8boR2flLBkGV/VB5VvnBBswP6Z0CCwMcT0 M5+z7oLnbJdPIJ58kAKDvg6Fu9S/8Y5KVwUiZp3KkNRl9L5lDQY= =bZTL -----END PGP SIGNATURE----- Merge 4.19.137 into android-4.19-stable Changes in 4.19.137 crypto: ccp - Release all allocated memory if sha type is invalid media: rc: prevent memory leak in cx23888_ir_probe iio: imu: adis16400: fix memory leak drm/amdgpu: fix multiple memory leaks in acp_hw_init tracing: Have error path in predicate_parse() free its allocated memory ath9k_htc: release allocated buffer if timed out ath9k: release allocated buffer if timed out drm/amd/display: prevent memory leak btrfs: inode: Verify inode mode to avoid NULL pointer dereference sctp: implement memory accounting on tx path Btrfs: fix selftests failure due to uninitialized i_mode in test inodes PCI/ASPM: Disable ASPM on ASMedia ASM1083/1085 PCIe-to-PCI bridge 9p/trans_fd: Fix concurrency del of req_list in p9_fd_cancelled/p9_read_work wireless: Use offsetof instead of custom macro. ARM: 8986/1: hw_breakpoint: Don't invoke overflow handler on uaccess watchpoints Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers" drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl() drm: hold gem reference until object is no longer accessed rds: Prevent kernel-infoleak in rds_notify_queue_get() xfs: fix missed wakeup on l_flush_wait net/x25: Fix x25_neigh refcnt leak when x25 disconnect net/x25: Fix null-ptr-deref in x25_disconnect xfrm: Fix crash when the hold queue is used. selftests/net: rxtimestamp: fix clang issues for target arch PowerPC selftests/net: psock_fanout: fix clang issues for target arch PowerPC sh: Fix validation of system call number net/mlx5: Verify Hardware supports requested ptp function on a given pin net: lan78xx: add missing endpoint sanity check net: lan78xx: fix transfer-buffer memory leak mlx4: disable device on shutdown mlxsw: core: Increase scope of RCU read-side critical section mlxsw: core: Free EMAD transactions using kfree_rcu() ibmvnic: Fix IRQ mapping disposal in error path bpf: Fix map leak in HASH_OF_MAPS map mac80211: mesh: Free ie data when leaving mesh mac80211: mesh: Free pending skb when destroying a mpath arm64/alternatives: move length validation inside the subsection arm64: csum: Fix handling of bad packets Bluetooth: fix kernel oops in store_pending_adv_report net: gemini: Fix missing clk_disable_unprepare() in error path of gemini_ethernet_port_probe() net/mlx5e: fix bpf_prog reference count leaks in mlx5e_alloc_rq usb: hso: Fix debug compile warning on sparc32 qed: Disable "MFW indication via attention" SPAM every 5 minutes nfc: s3fwrn5: add missing release on skb in s3fwrn5_recv_frame parisc: add support for cmpxchg on u8 pointers net: ethernet: ravb: exit if re-initialization fails in tx timeout Revert "i2c: cadence: Fix the hold bit setting" x86/unwind/orc: Fix ORC for newly forked tasks cxgb4: add missing release on skb in uld_send() xen-netfront: fix potential deadlock in xennet_remove() KVM: LAPIC: Prevent setting the tscdeadline timer if the lapic is hw disabled x86/i8259: Use printk_deferred() to prevent deadlock Linux 4.19.137 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ic57c1620f2febb595f4f764757b1792ffc866643
This commit is contained in:
commit
a5218b3636
2
Makefile
2
Makefile
|
|
@ -1,7 +1,7 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 19
|
||||
SUBLEVEL = 136
|
||||
SUBLEVEL = 137
|
||||
EXTRAVERSION =
|
||||
NAME = "People's Front"
|
||||
|
||||
|
|
|
|||
|
|
@ -688,6 +688,12 @@ static void disable_single_step(struct perf_event *bp)
|
|||
arch_install_hw_breakpoint(bp);
|
||||
}
|
||||
|
||||
static int watchpoint_fault_on_uaccess(struct pt_regs *regs,
|
||||
struct arch_hw_breakpoint *info)
|
||||
{
|
||||
return !user_mode(regs) && info->ctrl.privilege == ARM_BREAKPOINT_USER;
|
||||
}
|
||||
|
||||
static void watchpoint_handler(unsigned long addr, unsigned int fsr,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
|
|
@ -747,16 +753,27 @@ static void watchpoint_handler(unsigned long addr, unsigned int fsr,
|
|||
}
|
||||
|
||||
pr_debug("watchpoint fired: address = 0x%x\n", info->trigger);
|
||||
|
||||
/*
|
||||
* If we triggered a user watchpoint from a uaccess routine,
|
||||
* then handle the stepping ourselves since userspace really
|
||||
* can't help us with this.
|
||||
*/
|
||||
if (watchpoint_fault_on_uaccess(regs, info))
|
||||
goto step;
|
||||
|
||||
perf_bp_event(wp, regs);
|
||||
|
||||
/*
|
||||
* If no overflow handler is present, insert a temporary
|
||||
* mismatch breakpoint so we can single-step over the
|
||||
* watchpoint trigger.
|
||||
* Defer stepping to the overflow handler if one is installed.
|
||||
* Otherwise, insert a temporary mismatch breakpoint so that
|
||||
* we can single-step over the watchpoint trigger.
|
||||
*/
|
||||
if (is_default_overflow_handler(wp))
|
||||
enable_single_step(wp, instruction_pointer(regs));
|
||||
if (!is_default_overflow_handler(wp))
|
||||
goto unlock;
|
||||
|
||||
step:
|
||||
enable_single_step(wp, instruction_pointer(regs));
|
||||
unlock:
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,16 +30,17 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
|
|||
{
|
||||
__uint128_t tmp;
|
||||
u64 sum;
|
||||
int n = ihl; /* we want it signed */
|
||||
|
||||
tmp = *(const __uint128_t *)iph;
|
||||
iph += 16;
|
||||
ihl -= 4;
|
||||
n -= 4;
|
||||
tmp += ((tmp >> 64) | (tmp << 64));
|
||||
sum = tmp >> 64;
|
||||
do {
|
||||
sum += *(const u32 *)iph;
|
||||
iph += 4;
|
||||
} while (--ihl);
|
||||
} while (--n > 0);
|
||||
|
||||
sum += ((sum >> 32) | (sum << 32));
|
||||
return csum_fold((__force u32)(sum >> 32));
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ extern void __cmpxchg_called_with_bad_pointer(void);
|
|||
extern unsigned long __cmpxchg_u32(volatile unsigned int *m, unsigned int old,
|
||||
unsigned int new_);
|
||||
extern u64 __cmpxchg_u64(volatile u64 *ptr, u64 old, u64 new_);
|
||||
extern u8 __cmpxchg_u8(volatile u8 *ptr, u8 old, u8 new_);
|
||||
|
||||
/* don't worry...optimizer will get rid of most of this */
|
||||
static inline unsigned long
|
||||
|
|
@ -71,6 +72,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
|
|||
#endif
|
||||
case 4: return __cmpxchg_u32((unsigned int *)ptr,
|
||||
(unsigned int)old, (unsigned int)new_);
|
||||
case 1: return __cmpxchg_u8((u8 *)ptr, (u8)old, (u8)new_);
|
||||
}
|
||||
__cmpxchg_called_with_bad_pointer();
|
||||
return old;
|
||||
|
|
|
|||
|
|
@ -79,3 +79,15 @@ unsigned long __cmpxchg_u32(volatile unsigned int *ptr, unsigned int old, unsign
|
|||
_atomic_spin_unlock_irqrestore(ptr, flags);
|
||||
return (unsigned long)prev;
|
||||
}
|
||||
|
||||
u8 __cmpxchg_u8(volatile u8 *ptr, u8 old, u8 new)
|
||||
{
|
||||
unsigned long flags;
|
||||
u8 prev;
|
||||
|
||||
_atomic_spin_lock_irqsave(ptr, flags);
|
||||
if ((prev = *ptr) == old)
|
||||
*ptr = new;
|
||||
_atomic_spin_unlock_irqrestore(ptr, flags);
|
||||
return prev;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ syscall_trace_entry:
|
|||
mov.l @(OFF_R7,r15), r7 ! arg3
|
||||
mov.l @(OFF_R3,r15), r3 ! syscall_nr
|
||||
!
|
||||
mov.l 2f, r10 ! Number of syscalls
|
||||
mov.l 6f, r10 ! Number of syscalls
|
||||
cmp/hs r10, r3
|
||||
bf syscall_call
|
||||
mov #-ENOSYS, r0
|
||||
|
|
@ -357,7 +357,7 @@ ENTRY(system_call)
|
|||
tst r9, r8
|
||||
bf syscall_trace_entry
|
||||
!
|
||||
mov.l 2f, r8 ! Number of syscalls
|
||||
mov.l 6f, r8 ! Number of syscalls
|
||||
cmp/hs r8, r3
|
||||
bt syscall_badsys
|
||||
!
|
||||
|
|
@ -396,7 +396,7 @@ syscall_exit:
|
|||
#if !defined(CONFIG_CPU_SH2)
|
||||
1: .long TRA
|
||||
#endif
|
||||
2: .long NR_syscalls
|
||||
6: .long NR_syscalls
|
||||
3: .long sys_call_table
|
||||
7: .long do_syscall_trace_enter
|
||||
8: .long do_syscall_trace_leave
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ static void mask_and_ack_8259A(struct irq_data *data)
|
|||
* lets ACK and report it. [once per IRQ]
|
||||
*/
|
||||
if (!(spurious_irq_mask & irqmask)) {
|
||||
printk(KERN_DEBUG
|
||||
printk_deferred(KERN_DEBUG
|
||||
"spurious 8259A interrupt: IRQ%d.\n", irq);
|
||||
spurious_irq_mask |= irqmask;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -420,8 +420,11 @@ bool unwind_next_frame(struct unwind_state *state)
|
|||
/*
|
||||
* Find the orc_entry associated with the text address.
|
||||
*
|
||||
* Decrement call return addresses by one so they work for sibling
|
||||
* calls and calls to noreturn functions.
|
||||
* For a call frame (as opposed to a signal frame), state->ip points to
|
||||
* the instruction after the call. That instruction's stack layout
|
||||
* could be different from the call instruction's layout, for example
|
||||
* if the call was to a noreturn function. So get the ORC data for the
|
||||
* call instruction itself.
|
||||
*/
|
||||
orc = orc_find(state->signal ? state->ip : state->ip - 1);
|
||||
if (!orc)
|
||||
|
|
@ -634,6 +637,7 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task,
|
|||
state->sp = task->thread.sp;
|
||||
state->bp = READ_ONCE_NOCHECK(frame->bp);
|
||||
state->ip = READ_ONCE_NOCHECK(frame->ret_addr);
|
||||
state->signal = (void *)state->ip == ret_from_fork;
|
||||
}
|
||||
|
||||
if (get_stack_info((unsigned long *)state->sp, state->task,
|
||||
|
|
|
|||
|
|
@ -2034,7 +2034,7 @@ void kvm_set_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu, u64 data)
|
|||
{
|
||||
struct kvm_lapic *apic = vcpu->arch.apic;
|
||||
|
||||
if (!lapic_in_kernel(vcpu) || apic_lvtt_oneshot(apic) ||
|
||||
if (!kvm_apic_present(vcpu) || apic_lvtt_oneshot(apic) ||
|
||||
apic_lvtt_period(apic))
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -1783,8 +1783,9 @@ ccp_run_sha_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
|
|||
LSB_ITEM_SIZE);
|
||||
break;
|
||||
default:
|
||||
kfree(hmac_buf);
|
||||
ret = -EINVAL;
|
||||
goto e_ctx;
|
||||
goto e_data;
|
||||
}
|
||||
|
||||
memset(&hmac_cmd, 0, sizeof(hmac_cmd));
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ static int acp_hw_init(void *handle)
|
|||
u32 val = 0;
|
||||
u32 count = 0;
|
||||
struct device *dev;
|
||||
struct i2s_platform_data *i2s_pdata;
|
||||
struct i2s_platform_data *i2s_pdata = NULL;
|
||||
|
||||
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
|
||||
|
||||
|
|
@ -317,20 +317,21 @@ static int acp_hw_init(void *handle)
|
|||
adev->acp.acp_cell = kcalloc(ACP_DEVS, sizeof(struct mfd_cell),
|
||||
GFP_KERNEL);
|
||||
|
||||
if (adev->acp.acp_cell == NULL)
|
||||
return -ENOMEM;
|
||||
if (adev->acp.acp_cell == NULL) {
|
||||
r = -ENOMEM;
|
||||
goto failure;
|
||||
}
|
||||
|
||||
adev->acp.acp_res = kcalloc(5, sizeof(struct resource), GFP_KERNEL);
|
||||
if (adev->acp.acp_res == NULL) {
|
||||
kfree(adev->acp.acp_cell);
|
||||
return -ENOMEM;
|
||||
r = -ENOMEM;
|
||||
goto failure;
|
||||
}
|
||||
|
||||
i2s_pdata = kcalloc(3, sizeof(struct i2s_platform_data), GFP_KERNEL);
|
||||
if (i2s_pdata == NULL) {
|
||||
kfree(adev->acp.acp_res);
|
||||
kfree(adev->acp.acp_cell);
|
||||
return -ENOMEM;
|
||||
r = -ENOMEM;
|
||||
goto failure;
|
||||
}
|
||||
|
||||
switch (adev->asic_type) {
|
||||
|
|
@ -427,7 +428,7 @@ static int acp_hw_init(void *handle)
|
|||
r = mfd_add_hotplug_devices(adev->acp.parent, adev->acp.acp_cell,
|
||||
ACP_DEVS);
|
||||
if (r)
|
||||
return r;
|
||||
goto failure;
|
||||
|
||||
if (adev->asic_type != CHIP_STONEY) {
|
||||
for (i = 0; i < ACP_DEVS ; i++) {
|
||||
|
|
@ -435,7 +436,7 @@ static int acp_hw_init(void *handle)
|
|||
r = pm_genpd_add_device(&adev->acp.acp_genpd->gpd, dev);
|
||||
if (r) {
|
||||
dev_err(dev, "Failed to add dev to genpd\n");
|
||||
return r;
|
||||
goto failure;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -454,7 +455,8 @@ static int acp_hw_init(void *handle)
|
|||
break;
|
||||
if (--count == 0) {
|
||||
dev_err(&adev->pdev->dev, "Failed to reset ACP\n");
|
||||
return -ETIMEDOUT;
|
||||
r = -ETIMEDOUT;
|
||||
goto failure;
|
||||
}
|
||||
udelay(100);
|
||||
}
|
||||
|
|
@ -471,7 +473,8 @@ static int acp_hw_init(void *handle)
|
|||
break;
|
||||
if (--count == 0) {
|
||||
dev_err(&adev->pdev->dev, "Failed to reset ACP\n");
|
||||
return -ETIMEDOUT;
|
||||
r = -ETIMEDOUT;
|
||||
goto failure;
|
||||
}
|
||||
udelay(100);
|
||||
}
|
||||
|
|
@ -480,6 +483,13 @@ static int acp_hw_init(void *handle)
|
|||
val &= ~ACP_SOFT_RESET__SoftResetAud_MASK;
|
||||
cgs_write_register(adev->acp.cgs_device, mmACP_SOFT_RESET, val);
|
||||
return 0;
|
||||
|
||||
failure:
|
||||
kfree(i2s_pdata);
|
||||
kfree(adev->acp.acp_res);
|
||||
kfree(adev->acp.acp_cell);
|
||||
kfree(adev->acp.acp_genpd);
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -549,9 +549,10 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
|
|||
return n ? -EFAULT : 0;
|
||||
}
|
||||
case AMDGPU_INFO_DEV_INFO: {
|
||||
struct drm_amdgpu_info_device dev_info = {};
|
||||
struct drm_amdgpu_info_device dev_info;
|
||||
uint64_t vm_size;
|
||||
|
||||
memset(&dev_info, 0, sizeof(dev_info));
|
||||
dev_info.device_id = dev->pdev->device;
|
||||
dev_info.chip_rev = adev->rev_id;
|
||||
dev_info.external_rev = adev->external_rev_id;
|
||||
|
|
|
|||
|
|
@ -529,7 +529,8 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev,
|
|||
|
||||
while (isspace(*++tmp_str));
|
||||
|
||||
while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
|
||||
while (tmp_str[0]) {
|
||||
sub_str = strsep(&tmp_str, delimiter);
|
||||
ret = kstrtol(sub_str, 0, ¶meter[parameter_size]);
|
||||
if (ret)
|
||||
return -EINVAL;
|
||||
|
|
@ -629,7 +630,8 @@ static ssize_t amdgpu_read_mask(const char *buf, size_t count, uint32_t *mask)
|
|||
memcpy(buf_cpy, buf, bytes);
|
||||
buf_cpy[bytes] = '\0';
|
||||
tmp = buf_cpy;
|
||||
while ((sub_str = strsep(&tmp, delimiter)) != NULL) {
|
||||
while (tmp[0]) {
|
||||
sub_str = strsep(&tmp, delimiter);
|
||||
if (strlen(sub_str)) {
|
||||
ret = kstrtol(sub_str, 0, &level);
|
||||
if (ret)
|
||||
|
|
@ -880,7 +882,8 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev,
|
|||
i++;
|
||||
memcpy(buf_cpy, buf, count-i);
|
||||
tmp_str = buf_cpy;
|
||||
while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
|
||||
while (tmp_str[0]) {
|
||||
sub_str = strsep(&tmp_str, delimiter);
|
||||
ret = kstrtol(sub_str, 0, ¶meter[parameter_size]);
|
||||
if (ret) {
|
||||
count = -EINVAL;
|
||||
|
|
|
|||
|
|
@ -1001,6 +1001,7 @@ struct resource_pool *dce100_create_resource_pool(
|
|||
if (construct(num_virtual_links, dc, pool))
|
||||
return &pool->base;
|
||||
|
||||
kfree(pool);
|
||||
BREAK_TO_DEBUGGER();
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1344,6 +1344,7 @@ struct resource_pool *dce110_create_resource_pool(
|
|||
if (construct(num_virtual_links, dc, pool, asic_id))
|
||||
return &pool->base;
|
||||
|
||||
kfree(pool);
|
||||
BREAK_TO_DEBUGGER();
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1287,6 +1287,7 @@ struct resource_pool *dce112_create_resource_pool(
|
|||
if (construct(num_virtual_links, dc, pool))
|
||||
return &pool->base;
|
||||
|
||||
kfree(pool);
|
||||
BREAK_TO_DEBUGGER();
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1076,6 +1076,7 @@ struct resource_pool *dce120_create_resource_pool(
|
|||
if (construct(num_virtual_links, dc, pool))
|
||||
return &pool->base;
|
||||
|
||||
kfree(pool);
|
||||
BREAK_TO_DEBUGGER();
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1361,6 +1361,7 @@ struct resource_pool *dcn10_create_resource_pool(
|
|||
if (construct(num_virtual_links, dc, pool))
|
||||
return &pool->base;
|
||||
|
||||
kfree(pool);
|
||||
BREAK_TO_DEBUGGER();
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -731,9 +731,6 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
|
|||
* @file_priv: drm file-private structure
|
||||
*
|
||||
* Open an object using the global name, returning a handle and the size.
|
||||
*
|
||||
* This handle (of course) holds a reference to the object, so the object
|
||||
* will not go away until the handle is deleted.
|
||||
*/
|
||||
int
|
||||
drm_gem_open_ioctl(struct drm_device *dev, void *data,
|
||||
|
|
@ -758,14 +755,15 @@ drm_gem_open_ioctl(struct drm_device *dev, void *data,
|
|||
|
||||
/* drm_gem_handle_create_tail unlocks dev->object_name_lock. */
|
||||
ret = drm_gem_handle_create_tail(file_priv, obj, &handle);
|
||||
drm_gem_object_put_unlocked(obj);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err;
|
||||
|
||||
args->handle = handle;
|
||||
args->size = obj->size;
|
||||
|
||||
return 0;
|
||||
err:
|
||||
drm_gem_object_put_unlocked(obj);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -382,10 +382,8 @@ static void cdns_i2c_mrecv(struct cdns_i2c *id)
|
|||
* Check for the message size against FIFO depth and set the
|
||||
* 'hold bus' bit if it is greater than FIFO depth.
|
||||
*/
|
||||
if ((id->recv_count > CDNS_I2C_FIFO_DEPTH) || id->bus_hold_flag)
|
||||
if (id->recv_count > CDNS_I2C_FIFO_DEPTH)
|
||||
ctrl_reg |= CDNS_I2C_CR_HOLD;
|
||||
else
|
||||
ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD;
|
||||
|
||||
cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET);
|
||||
|
||||
|
|
@ -442,11 +440,8 @@ static void cdns_i2c_msend(struct cdns_i2c *id)
|
|||
* Check for the message size against FIFO depth and set the
|
||||
* 'hold bus' bit if it is greater than FIFO depth.
|
||||
*/
|
||||
if ((id->send_count > CDNS_I2C_FIFO_DEPTH) || id->bus_hold_flag)
|
||||
if (id->send_count > CDNS_I2C_FIFO_DEPTH)
|
||||
ctrl_reg |= CDNS_I2C_CR_HOLD;
|
||||
else
|
||||
ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD;
|
||||
|
||||
cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET);
|
||||
|
||||
/* Clear the interrupts in interrupt status register. */
|
||||
|
|
|
|||
|
|
@ -38,8 +38,11 @@ int adis16400_update_scan_mode(struct iio_dev *indio_dev,
|
|||
return -ENOMEM;
|
||||
|
||||
adis->buffer = kzalloc(burst_length + sizeof(u16), GFP_KERNEL);
|
||||
if (!adis->buffer)
|
||||
if (!adis->buffer) {
|
||||
kfree(adis->xfer);
|
||||
adis->xfer = NULL;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
tx = adis->buffer + burst_length;
|
||||
tx[0] = ADIS_READ_REG(ADIS16400_GLOB_CMD);
|
||||
|
|
|
|||
|
|
@ -1178,8 +1178,11 @@ int cx23888_ir_probe(struct cx23885_dev *dev)
|
|||
return -ENOMEM;
|
||||
|
||||
spin_lock_init(&state->rx_kfifo_lock);
|
||||
if (kfifo_alloc(&state->rx_kfifo, CX23888_IR_RX_KFIFO_SIZE, GFP_KERNEL))
|
||||
if (kfifo_alloc(&state->rx_kfifo, CX23888_IR_RX_KFIFO_SIZE,
|
||||
GFP_KERNEL)) {
|
||||
kfree(state);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
state->dev = dev;
|
||||
sd = &state->sd;
|
||||
|
|
|
|||
|
|
@ -2367,6 +2367,7 @@ static inline int uld_send(struct adapter *adap, struct sk_buff *skb,
|
|||
txq_info = adap->sge.uld_txq_info[tx_uld_type];
|
||||
if (unlikely(!txq_info)) {
|
||||
WARN_ON(true);
|
||||
kfree_skb(skb);
|
||||
return NET_XMIT_DROP;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2451,6 +2451,7 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)
|
|||
port->reset = devm_reset_control_get_exclusive(dev, NULL);
|
||||
if (IS_ERR(port->reset)) {
|
||||
dev_err(dev, "no reset\n");
|
||||
clk_disable_unprepare(port->pclk);
|
||||
return PTR_ERR(port->reset);
|
||||
}
|
||||
reset_control_reset(port->reset);
|
||||
|
|
@ -2506,8 +2507,10 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)
|
|||
IRQF_SHARED,
|
||||
port_names[port->id],
|
||||
port);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
clk_disable_unprepare(port->pclk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = register_netdev(netdev);
|
||||
if (!ret) {
|
||||
|
|
|
|||
|
|
@ -2926,7 +2926,7 @@ static int init_sub_crq_irqs(struct ibmvnic_adapter *adapter)
|
|||
req_tx_irq_failed:
|
||||
for (j = 0; j < i; j++) {
|
||||
free_irq(adapter->tx_scrq[j]->irq, adapter->tx_scrq[j]);
|
||||
irq_dispose_mapping(adapter->rx_scrq[j]->irq);
|
||||
irq_dispose_mapping(adapter->tx_scrq[j]->irq);
|
||||
}
|
||||
release_sub_crqs(adapter, 1);
|
||||
return rc;
|
||||
|
|
|
|||
|
|
@ -4311,12 +4311,14 @@ static void mlx4_pci_resume(struct pci_dev *pdev)
|
|||
static void mlx4_shutdown(struct pci_dev *pdev)
|
||||
{
|
||||
struct mlx4_dev_persistent *persist = pci_get_drvdata(pdev);
|
||||
struct mlx4_dev *dev = persist->dev;
|
||||
|
||||
mlx4_info(persist->dev, "mlx4_shutdown was called\n");
|
||||
mutex_lock(&persist->interface_state_mutex);
|
||||
if (persist->interface_state & MLX4_INTERFACE_STATE_UP)
|
||||
mlx4_unload_one(pdev);
|
||||
mutex_unlock(&persist->interface_state_mutex);
|
||||
mlx4_pci_disable_device(dev);
|
||||
}
|
||||
|
||||
static const struct pci_error_handlers mlx4_err_handler = {
|
||||
|
|
|
|||
|
|
@ -519,7 +519,7 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c,
|
|||
err = mlx5_wq_ll_create(mdev, &rqp->wq, rqc_wq, &rq->mpwqe.wq,
|
||||
&rq->wq_ctrl);
|
||||
if (err)
|
||||
return err;
|
||||
goto err_rq_wq_destroy;
|
||||
|
||||
rq->mpwqe.wq.db = &rq->mpwqe.wq.db[MLX5_RCV_DBR];
|
||||
|
||||
|
|
@ -564,7 +564,7 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c,
|
|||
err = mlx5_wq_cyc_create(mdev, &rqp->wq, rqc_wq, &rq->wqe.wq,
|
||||
&rq->wq_ctrl);
|
||||
if (err)
|
||||
return err;
|
||||
goto err_rq_wq_destroy;
|
||||
|
||||
rq->wqe.wq.db = &rq->wqe.wq.db[MLX5_RCV_DBR];
|
||||
|
||||
|
|
|
|||
|
|
@ -366,10 +366,31 @@ static int mlx5_ptp_enable(struct ptp_clock_info *ptp,
|
|||
return 0;
|
||||
}
|
||||
|
||||
enum {
|
||||
MLX5_MTPPS_REG_CAP_PIN_X_MODE_SUPPORT_PPS_IN = BIT(0),
|
||||
MLX5_MTPPS_REG_CAP_PIN_X_MODE_SUPPORT_PPS_OUT = BIT(1),
|
||||
};
|
||||
|
||||
static int mlx5_ptp_verify(struct ptp_clock_info *ptp, unsigned int pin,
|
||||
enum ptp_pin_function func, unsigned int chan)
|
||||
{
|
||||
return (func == PTP_PF_PHYSYNC) ? -EOPNOTSUPP : 0;
|
||||
struct mlx5_clock *clock = container_of(ptp, struct mlx5_clock,
|
||||
ptp_info);
|
||||
|
||||
switch (func) {
|
||||
case PTP_PF_NONE:
|
||||
return 0;
|
||||
case PTP_PF_EXTTS:
|
||||
return !(clock->pps_info.pin_caps[pin] &
|
||||
MLX5_MTPPS_REG_CAP_PIN_X_MODE_SUPPORT_PPS_IN);
|
||||
case PTP_PF_PEROUT:
|
||||
return !(clock->pps_info.pin_caps[pin] &
|
||||
MLX5_MTPPS_REG_CAP_PIN_X_MODE_SUPPORT_PPS_OUT);
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static const struct ptp_clock_info mlx5_ptp_clock_info = {
|
||||
|
|
|
|||
|
|
@ -1384,7 +1384,7 @@ static int mlxsw_core_reg_access_emad(struct mlxsw_core *mlxsw_core,
|
|||
err = mlxsw_emad_reg_access(mlxsw_core, reg, payload, type, trans,
|
||||
bulk_list, cb, cb_priv, tid);
|
||||
if (err) {
|
||||
kfree(trans);
|
||||
kfree_rcu(trans, rcu);
|
||||
return err;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -1605,11 +1605,13 @@ void mlxsw_core_skb_receive(struct mlxsw_core *mlxsw_core, struct sk_buff *skb,
|
|||
break;
|
||||
}
|
||||
}
|
||||
rcu_read_unlock();
|
||||
if (!found)
|
||||
if (!found) {
|
||||
rcu_read_unlock();
|
||||
goto drop;
|
||||
}
|
||||
|
||||
rxl->func(skb, local_port, rxl_item->priv);
|
||||
rcu_read_unlock();
|
||||
return;
|
||||
|
||||
drop:
|
||||
|
|
|
|||
|
|
@ -1015,7 +1015,8 @@ static int qed_int_attentions(struct qed_hwfn *p_hwfn)
|
|||
index, attn_bits, attn_acks, asserted_bits,
|
||||
deasserted_bits, p_sb_attn_sw->known_attn);
|
||||
} else if (asserted_bits == 0x100) {
|
||||
DP_INFO(p_hwfn, "MFW indication via attention\n");
|
||||
DP_VERBOSE(p_hwfn, NETIF_MSG_INTR,
|
||||
"MFW indication via attention\n");
|
||||
} else {
|
||||
DP_VERBOSE(p_hwfn, NETIF_MSG_INTR,
|
||||
"MFW indication [deassertion]\n");
|
||||
|
|
|
|||
|
|
@ -1445,6 +1445,7 @@ static void ravb_tx_timeout_work(struct work_struct *work)
|
|||
struct ravb_private *priv = container_of(work, struct ravb_private,
|
||||
work);
|
||||
struct net_device *ndev = priv->ndev;
|
||||
int error;
|
||||
|
||||
netif_tx_stop_all_queues(ndev);
|
||||
|
||||
|
|
@ -1453,15 +1454,36 @@ static void ravb_tx_timeout_work(struct work_struct *work)
|
|||
ravb_ptp_stop(ndev);
|
||||
|
||||
/* Wait for DMA stopping */
|
||||
ravb_stop_dma(ndev);
|
||||
if (ravb_stop_dma(ndev)) {
|
||||
/* If ravb_stop_dma() fails, the hardware is still operating
|
||||
* for TX and/or RX. So, this should not call the following
|
||||
* functions because ravb_dmac_init() is possible to fail too.
|
||||
* Also, this should not retry ravb_stop_dma() again and again
|
||||
* here because it's possible to wait forever. So, this just
|
||||
* re-enables the TX and RX and skip the following
|
||||
* re-initialization procedure.
|
||||
*/
|
||||
ravb_rcv_snd_enable(ndev);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ravb_ring_free(ndev, RAVB_BE);
|
||||
ravb_ring_free(ndev, RAVB_NC);
|
||||
|
||||
/* Device init */
|
||||
ravb_dmac_init(ndev);
|
||||
error = ravb_dmac_init(ndev);
|
||||
if (error) {
|
||||
/* If ravb_dmac_init() fails, descriptors are freed. So, this
|
||||
* should return here to avoid re-enabling the TX and RX in
|
||||
* ravb_emac_init().
|
||||
*/
|
||||
netdev_err(ndev, "%s: ravb_dmac_init() failed, error %d\n",
|
||||
__func__, error);
|
||||
return;
|
||||
}
|
||||
ravb_emac_init(ndev);
|
||||
|
||||
out:
|
||||
/* Initialise PTP Clock driver */
|
||||
if (priv->chip_id == RCAR_GEN2)
|
||||
ravb_ptp_init(ndev, priv->pdev);
|
||||
|
|
|
|||
|
|
@ -1403,8 +1403,9 @@ static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old)
|
|||
unsigned long flags;
|
||||
|
||||
if (old)
|
||||
hso_dbg(0x16, "Termios called with: cflags new[%d] - old[%d]\n",
|
||||
tty->termios.c_cflag, old->c_cflag);
|
||||
hso_dbg(0x16, "Termios called with: cflags new[%u] - old[%u]\n",
|
||||
(unsigned int)tty->termios.c_cflag,
|
||||
(unsigned int)old->c_cflag);
|
||||
|
||||
/* the actual setup */
|
||||
spin_lock_irqsave(&serial->serial_lock, flags);
|
||||
|
|
|
|||
|
|
@ -3786,6 +3786,11 @@ static int lan78xx_probe(struct usb_interface *intf,
|
|||
netdev->max_mtu = MAX_SINGLE_PACKET_SIZE;
|
||||
netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER);
|
||||
|
||||
if (intf->cur_altsetting->desc.bNumEndpoints < 3) {
|
||||
ret = -ENODEV;
|
||||
goto out3;
|
||||
}
|
||||
|
||||
dev->ep_blkin = (intf->cur_altsetting)->endpoint + 0;
|
||||
dev->ep_blkout = (intf->cur_altsetting)->endpoint + 1;
|
||||
dev->ep_intr = (intf->cur_altsetting)->endpoint + 2;
|
||||
|
|
@ -3810,6 +3815,7 @@ static int lan78xx_probe(struct usb_interface *intf,
|
|||
usb_fill_int_urb(dev->urb_intr, dev->udev,
|
||||
dev->pipe_intr, buf, maxp,
|
||||
intr_complete, dev, period);
|
||||
dev->urb_intr->transfer_flags |= URB_FREE_BUFFER;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -173,6 +173,7 @@ static int htc_config_pipe_credits(struct htc_target *target)
|
|||
time_left = wait_for_completion_timeout(&target->cmd_wait, HZ);
|
||||
if (!time_left) {
|
||||
dev_err(target->dev, "HTC credit config timeout\n");
|
||||
kfree_skb(skb);
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
|
|
@ -208,6 +209,7 @@ static int htc_setup_complete(struct htc_target *target)
|
|||
time_left = wait_for_completion_timeout(&target->cmd_wait, HZ);
|
||||
if (!time_left) {
|
||||
dev_err(target->dev, "HTC start timeout\n");
|
||||
kfree_skb(skb);
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
|
|
@ -280,6 +282,7 @@ int htc_connect_service(struct htc_target *target,
|
|||
if (!time_left) {
|
||||
dev_err(target->dev, "Service connection timeout for: %d\n",
|
||||
service_connreq->service_id);
|
||||
kfree_skb(skb);
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -339,6 +339,7 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id,
|
|||
ath_dbg(common, WMI, "Timeout waiting for WMI command: %s\n",
|
||||
wmi_cmd_to_name(cmd_id));
|
||||
mutex_unlock(&wmi->op_mutex);
|
||||
kfree_skb(skb);
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ module_param_named(max_queues, xennet_max_queues, uint, 0644);
|
|||
MODULE_PARM_DESC(max_queues,
|
||||
"Maximum number of queues per virtual interface");
|
||||
|
||||
#define XENNET_TIMEOUT (5 * HZ)
|
||||
|
||||
static const struct ethtool_ops xennet_ethtool_ops;
|
||||
|
||||
struct netfront_cb {
|
||||
|
|
@ -1337,12 +1339,15 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)
|
|||
|
||||
netif_carrier_off(netdev);
|
||||
|
||||
xenbus_switch_state(dev, XenbusStateInitialising);
|
||||
wait_event(module_wq,
|
||||
xenbus_read_driver_state(dev->otherend) !=
|
||||
XenbusStateClosed &&
|
||||
xenbus_read_driver_state(dev->otherend) !=
|
||||
XenbusStateUnknown);
|
||||
do {
|
||||
xenbus_switch_state(dev, XenbusStateInitialising);
|
||||
err = wait_event_timeout(module_wq,
|
||||
xenbus_read_driver_state(dev->otherend) !=
|
||||
XenbusStateClosed &&
|
||||
xenbus_read_driver_state(dev->otherend) !=
|
||||
XenbusStateUnknown, XENNET_TIMEOUT);
|
||||
} while (!err);
|
||||
|
||||
return netdev;
|
||||
|
||||
exit:
|
||||
|
|
@ -2142,28 +2147,43 @@ static const struct attribute_group xennet_dev_group = {
|
|||
};
|
||||
#endif /* CONFIG_SYSFS */
|
||||
|
||||
static void xennet_bus_close(struct xenbus_device *dev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (xenbus_read_driver_state(dev->otherend) == XenbusStateClosed)
|
||||
return;
|
||||
do {
|
||||
xenbus_switch_state(dev, XenbusStateClosing);
|
||||
ret = wait_event_timeout(module_wq,
|
||||
xenbus_read_driver_state(dev->otherend) ==
|
||||
XenbusStateClosing ||
|
||||
xenbus_read_driver_state(dev->otherend) ==
|
||||
XenbusStateClosed ||
|
||||
xenbus_read_driver_state(dev->otherend) ==
|
||||
XenbusStateUnknown,
|
||||
XENNET_TIMEOUT);
|
||||
} while (!ret);
|
||||
|
||||
if (xenbus_read_driver_state(dev->otherend) == XenbusStateClosed)
|
||||
return;
|
||||
|
||||
do {
|
||||
xenbus_switch_state(dev, XenbusStateClosed);
|
||||
ret = wait_event_timeout(module_wq,
|
||||
xenbus_read_driver_state(dev->otherend) ==
|
||||
XenbusStateClosed ||
|
||||
xenbus_read_driver_state(dev->otherend) ==
|
||||
XenbusStateUnknown,
|
||||
XENNET_TIMEOUT);
|
||||
} while (!ret);
|
||||
}
|
||||
|
||||
static int xennet_remove(struct xenbus_device *dev)
|
||||
{
|
||||
struct netfront_info *info = dev_get_drvdata(&dev->dev);
|
||||
|
||||
dev_dbg(&dev->dev, "%s\n", dev->nodename);
|
||||
|
||||
if (xenbus_read_driver_state(dev->otherend) != XenbusStateClosed) {
|
||||
xenbus_switch_state(dev, XenbusStateClosing);
|
||||
wait_event(module_wq,
|
||||
xenbus_read_driver_state(dev->otherend) ==
|
||||
XenbusStateClosing ||
|
||||
xenbus_read_driver_state(dev->otherend) ==
|
||||
XenbusStateUnknown);
|
||||
|
||||
xenbus_switch_state(dev, XenbusStateClosed);
|
||||
wait_event(module_wq,
|
||||
xenbus_read_driver_state(dev->otherend) ==
|
||||
XenbusStateClosed ||
|
||||
xenbus_read_driver_state(dev->otherend) ==
|
||||
XenbusStateUnknown);
|
||||
}
|
||||
|
||||
xennet_bus_close(dev);
|
||||
xennet_disconnect_backend(info);
|
||||
|
||||
if (info->netdev->reg_state == NETREG_REGISTERED)
|
||||
|
|
|
|||
|
|
@ -209,6 +209,7 @@ int s3fwrn5_recv_frame(struct nci_dev *ndev, struct sk_buff *skb,
|
|||
case S3FWRN5_MODE_FW:
|
||||
return s3fwrn5_fw_recv_frame(ndev, skb);
|
||||
default:
|
||||
kfree_skb(skb);
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2307,6 +2307,19 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10f1, quirk_disable_aspm_l0s);
|
|||
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10f4, quirk_disable_aspm_l0s);
|
||||
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1508, quirk_disable_aspm_l0s);
|
||||
|
||||
static void quirk_disable_aspm_l0s_l1(struct pci_dev *dev)
|
||||
{
|
||||
pci_info(dev, "Disabling ASPM L0s/L1\n");
|
||||
pci_disable_link_state(dev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1);
|
||||
}
|
||||
|
||||
/*
|
||||
* ASM1083/1085 PCIe-PCI bridge devices cause AER timeout errors on the
|
||||
* upstream PCIe root port when ASPM is enabled. At least L0s mode is affected;
|
||||
* disable both L0s and L1 for now to be safe.
|
||||
*/
|
||||
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x1080, quirk_disable_aspm_l0s_l1);
|
||||
|
||||
/*
|
||||
* Some Pericom PCIe-to-PCI bridges in reverse mode need the PCIe Retrain
|
||||
* Link bit cleared after starting the link retrain process to allow this
|
||||
|
|
|
|||
|
|
@ -5553,12 +5553,14 @@ void btrfs_evict_inode(struct inode *inode)
|
|||
}
|
||||
|
||||
/*
|
||||
* this returns the key found in the dir entry in the location pointer.
|
||||
* Return the key found in the dir entry in the location pointer, fill @type
|
||||
* with BTRFS_FT_*, and return 0.
|
||||
*
|
||||
* If no dir entries were found, returns -ENOENT.
|
||||
* If found a corrupted location in dir entry, returns -EUCLEAN.
|
||||
*/
|
||||
static int btrfs_inode_by_name(struct inode *dir, struct dentry *dentry,
|
||||
struct btrfs_key *location)
|
||||
struct btrfs_key *location, u8 *type)
|
||||
{
|
||||
const char *name = dentry->d_name.name;
|
||||
int namelen = dentry->d_name.len;
|
||||
|
|
@ -5591,6 +5593,8 @@ static int btrfs_inode_by_name(struct inode *dir, struct dentry *dentry,
|
|||
__func__, name, btrfs_ino(BTRFS_I(dir)),
|
||||
location->objectid, location->type, location->offset);
|
||||
}
|
||||
if (!ret)
|
||||
*type = btrfs_dir_type(path->nodes[0], di);
|
||||
out:
|
||||
btrfs_free_path(path);
|
||||
return ret;
|
||||
|
|
@ -5826,6 +5830,11 @@ static struct inode *new_simple_dir(struct super_block *s,
|
|||
return inode;
|
||||
}
|
||||
|
||||
static inline u8 btrfs_inode_type(struct inode *inode)
|
||||
{
|
||||
return btrfs_type_by_mode[(inode->i_mode & S_IFMT) >> S_SHIFT];
|
||||
}
|
||||
|
||||
struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry)
|
||||
{
|
||||
struct btrfs_fs_info *fs_info = btrfs_sb(dir->i_sb);
|
||||
|
|
@ -5833,18 +5842,31 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry)
|
|||
struct btrfs_root *root = BTRFS_I(dir)->root;
|
||||
struct btrfs_root *sub_root = root;
|
||||
struct btrfs_key location;
|
||||
u8 di_type = 0;
|
||||
int index;
|
||||
int ret = 0;
|
||||
|
||||
if (dentry->d_name.len > BTRFS_NAME_LEN)
|
||||
return ERR_PTR(-ENAMETOOLONG);
|
||||
|
||||
ret = btrfs_inode_by_name(dir, dentry, &location);
|
||||
ret = btrfs_inode_by_name(dir, dentry, &location, &di_type);
|
||||
if (ret < 0)
|
||||
return ERR_PTR(ret);
|
||||
|
||||
if (location.type == BTRFS_INODE_ITEM_KEY) {
|
||||
inode = btrfs_iget(dir->i_sb, &location, root, NULL);
|
||||
if (IS_ERR(inode))
|
||||
return inode;
|
||||
|
||||
/* Do extra check against inode mode with di_type */
|
||||
if (btrfs_inode_type(inode) != di_type) {
|
||||
btrfs_crit(fs_info,
|
||||
"inode mode mismatch with dir: inode mode=0%o btrfs type=%u dir type=%u",
|
||||
inode->i_mode, btrfs_inode_type(inode),
|
||||
di_type);
|
||||
iput(inode);
|
||||
return ERR_PTR(-EUCLEAN);
|
||||
}
|
||||
return inode;
|
||||
}
|
||||
|
||||
|
|
@ -6455,11 +6477,6 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
|
|||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
static inline u8 btrfs_inode_type(struct inode *inode)
|
||||
{
|
||||
return btrfs_type_by_mode[(inode->i_mode & S_IFMT) >> S_SHIFT];
|
||||
}
|
||||
|
||||
/*
|
||||
* utility function to add 'inode' into 'parent_inode' with
|
||||
* a give name and a given sequence number.
|
||||
|
|
@ -6993,6 +7010,14 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode,
|
|||
extent_start = found_key.offset;
|
||||
if (found_type == BTRFS_FILE_EXTENT_REG ||
|
||||
found_type == BTRFS_FILE_EXTENT_PREALLOC) {
|
||||
/* Only regular file could have regular/prealloc extent */
|
||||
if (!S_ISREG(inode->vfs_inode.i_mode)) {
|
||||
ret = -EUCLEAN;
|
||||
btrfs_crit(fs_info,
|
||||
"regular/prealloc extent found for non-regular inode %llu",
|
||||
btrfs_ino(inode));
|
||||
goto out;
|
||||
}
|
||||
extent_end = extent_start +
|
||||
btrfs_file_extent_num_bytes(leaf, item);
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,13 @@ static struct file_system_type test_type = {
|
|||
|
||||
struct inode *btrfs_new_test_inode(void)
|
||||
{
|
||||
return new_inode(test_mnt->mnt_sb);
|
||||
struct inode *inode;
|
||||
|
||||
inode = new_inode(test_mnt->mnt_sb);
|
||||
if (inode)
|
||||
inode_init_owner(inode, NULL, S_IFREG);
|
||||
|
||||
return inode;
|
||||
}
|
||||
|
||||
static int btrfs_init_test_fs(void)
|
||||
|
|
|
|||
|
|
@ -232,6 +232,7 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|||
return ret;
|
||||
}
|
||||
|
||||
inode->i_mode = S_IFREG;
|
||||
BTRFS_I(inode)->location.type = BTRFS_INODE_ITEM_KEY;
|
||||
BTRFS_I(inode)->location.objectid = BTRFS_FIRST_FREE_OBJECTID;
|
||||
BTRFS_I(inode)->location.offset = 0;
|
||||
|
|
|
|||
|
|
@ -2712,7 +2712,6 @@ xlog_state_do_callback(
|
|||
int funcdidcallbacks; /* flag: function did callbacks */
|
||||
int repeats; /* for issuing console warnings if
|
||||
* looping too many times */
|
||||
int wake = 0;
|
||||
|
||||
spin_lock(&log->l_icloglock);
|
||||
first_iclog = iclog = log->l_iclog;
|
||||
|
|
@ -2914,11 +2913,9 @@ xlog_state_do_callback(
|
|||
#endif
|
||||
|
||||
if (log->l_iclog->ic_state & (XLOG_STATE_ACTIVE|XLOG_STATE_IOERROR))
|
||||
wake = 1;
|
||||
spin_unlock(&log->l_icloglock);
|
||||
|
||||
if (wake)
|
||||
wake_up_all(&log->l_flush_wait);
|
||||
|
||||
spin_unlock(&log->l_icloglock);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -4026,7 +4023,9 @@ xfs_log_force_umount(
|
|||
* item committed callback functions will do this again under lock to
|
||||
* avoid races.
|
||||
*/
|
||||
spin_lock(&log->l_cilp->xc_push_lock);
|
||||
wake_up_all(&log->l_cilp->xc_commit_wait);
|
||||
spin_unlock(&log->l_cilp->xc_push_lock);
|
||||
xlog_state_do_callback(log, XFS_LI_ABORTED, NULL);
|
||||
|
||||
#ifdef XFSERRORDEBUG
|
||||
|
|
|
|||
|
|
@ -1016,7 +1016,7 @@ struct xfrm_dst {
|
|||
static inline struct dst_entry *xfrm_dst_path(const struct dst_entry *dst)
|
||||
{
|
||||
#ifdef CONFIG_XFRM
|
||||
if (dst->xfrm) {
|
||||
if (dst->xfrm || (dst->flags & DST_XFRM_QUEUE)) {
|
||||
const struct xfrm_dst *xdst = (const struct xfrm_dst *) dst;
|
||||
|
||||
return xdst->path;
|
||||
|
|
@ -1028,7 +1028,7 @@ static inline struct dst_entry *xfrm_dst_path(const struct dst_entry *dst)
|
|||
static inline struct dst_entry *xfrm_dst_child(const struct dst_entry *dst)
|
||||
{
|
||||
#ifdef CONFIG_XFRM
|
||||
if (dst->xfrm) {
|
||||
if (dst->xfrm || (dst->flags & DST_XFRM_QUEUE)) {
|
||||
struct xfrm_dst *xdst = (struct xfrm_dst *) dst;
|
||||
return xdst->child;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,8 @@
|
|||
#include <linux/socket.h> /* for "struct sockaddr" et al */
|
||||
#include <linux/if.h> /* for IFNAMSIZ and co... */
|
||||
|
||||
#include <stddef.h> /* for offsetof */
|
||||
|
||||
/***************************** VERSION *****************************/
|
||||
/*
|
||||
* This constant is used to know the availability of the wireless
|
||||
|
|
@ -1090,8 +1092,7 @@ struct iw_event {
|
|||
/* iw_point events are special. First, the payload (extra data) come at
|
||||
* the end of the event, so they are bigger than IW_EV_POINT_LEN. Second,
|
||||
* we omit the pointer, so start at an offset. */
|
||||
#define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) - \
|
||||
(char *) NULL)
|
||||
#define IW_EV_POINT_OFF offsetof(struct iw_point, length)
|
||||
#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \
|
||||
IW_EV_POINT_OFF)
|
||||
|
||||
|
|
|
|||
|
|
@ -678,15 +678,20 @@ static void htab_elem_free_rcu(struct rcu_head *head)
|
|||
preempt_enable();
|
||||
}
|
||||
|
||||
static void free_htab_elem(struct bpf_htab *htab, struct htab_elem *l)
|
||||
static void htab_put_fd_value(struct bpf_htab *htab, struct htab_elem *l)
|
||||
{
|
||||
struct bpf_map *map = &htab->map;
|
||||
void *ptr;
|
||||
|
||||
if (map->ops->map_fd_put_ptr) {
|
||||
void *ptr = fd_htab_map_get_ptr(map, l);
|
||||
|
||||
ptr = fd_htab_map_get_ptr(map, l);
|
||||
map->ops->map_fd_put_ptr(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
static void free_htab_elem(struct bpf_htab *htab, struct htab_elem *l)
|
||||
{
|
||||
htab_put_fd_value(htab, l);
|
||||
|
||||
if (htab_is_prealloc(htab)) {
|
||||
__pcpu_freelist_push(&htab->freelist, &l->fnode);
|
||||
|
|
@ -747,6 +752,7 @@ static struct htab_elem *alloc_htab_elem(struct bpf_htab *htab, void *key,
|
|||
*/
|
||||
pl_new = this_cpu_ptr(htab->extra_elems);
|
||||
l_new = *pl_new;
|
||||
htab_put_fd_value(htab, old_elem);
|
||||
*pl_new = old_elem;
|
||||
} else {
|
||||
struct pcpu_freelist_node *l;
|
||||
|
|
|
|||
|
|
@ -451,8 +451,10 @@ predicate_parse(const char *str, int nr_parens, int nr_preds,
|
|||
|
||||
switch (*next) {
|
||||
case '(': /* #2 */
|
||||
if (top - op_stack > nr_parens)
|
||||
return ERR_PTR(-EINVAL);
|
||||
if (top - op_stack > nr_parens) {
|
||||
ret = -EINVAL;
|
||||
goto out_free;
|
||||
}
|
||||
*(++top) = invert;
|
||||
continue;
|
||||
case '!': /* #3 */
|
||||
|
|
|
|||
|
|
@ -377,6 +377,10 @@ static void p9_read_work(struct work_struct *work)
|
|||
if (m->rreq->status == REQ_STATUS_SENT) {
|
||||
list_del(&m->rreq->req_list);
|
||||
p9_client_cb(m->client, m->rreq, REQ_STATUS_RCVD);
|
||||
} else if (m->rreq->status == REQ_STATUS_FLSHD) {
|
||||
/* Ignore replies associated with a cancelled request. */
|
||||
p9_debug(P9_DEBUG_TRANS,
|
||||
"Ignore replies associated with a cancelled request\n");
|
||||
} else {
|
||||
spin_unlock(&m->client->lock);
|
||||
p9_debug(P9_DEBUG_ERROR,
|
||||
|
|
@ -718,11 +722,20 @@ static int p9_fd_cancelled(struct p9_client *client, struct p9_req_t *req)
|
|||
{
|
||||
p9_debug(P9_DEBUG_TRANS, "client %p req %p\n", client, req);
|
||||
|
||||
spin_lock(&client->lock);
|
||||
/* Ignore cancelled request if message has been received
|
||||
* before lock.
|
||||
*/
|
||||
if (req->status == REQ_STATUS_RCVD) {
|
||||
spin_unlock(&client->lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* we haven't received a response for oldreq,
|
||||
* remove it from the list.
|
||||
*/
|
||||
spin_lock(&client->lock);
|
||||
list_del(&req->req_list);
|
||||
req->status = REQ_STATUS_FLSHD;
|
||||
spin_unlock(&client->lock);
|
||||
p9_req_put(req);
|
||||
|
||||
|
|
|
|||
|
|
@ -1229,6 +1229,9 @@ static void store_pending_adv_report(struct hci_dev *hdev, bdaddr_t *bdaddr,
|
|||
{
|
||||
struct discovery_state *d = &hdev->discovery;
|
||||
|
||||
if (len > HCI_MAX_AD_LENGTH)
|
||||
return;
|
||||
|
||||
bacpy(&d->last_adv_addr, bdaddr);
|
||||
d->last_adv_addr_type = bdaddr_type;
|
||||
d->last_adv_rssi = rssi;
|
||||
|
|
@ -5116,7 +5119,8 @@ static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev,
|
|||
|
||||
static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
|
||||
u8 bdaddr_type, bdaddr_t *direct_addr,
|
||||
u8 direct_addr_type, s8 rssi, u8 *data, u8 len)
|
||||
u8 direct_addr_type, s8 rssi, u8 *data, u8 len,
|
||||
bool ext_adv)
|
||||
{
|
||||
struct discovery_state *d = &hdev->discovery;
|
||||
struct smp_irk *irk;
|
||||
|
|
@ -5138,6 +5142,11 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
|
|||
return;
|
||||
}
|
||||
|
||||
if (!ext_adv && len > HCI_MAX_AD_LENGTH) {
|
||||
bt_dev_err_ratelimited(hdev, "legacy adv larger than 31 bytes");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Find the end of the data in case the report contains padded zero
|
||||
* bytes at the end causing an invalid length value.
|
||||
*
|
||||
|
|
@ -5197,7 +5206,7 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
|
|||
*/
|
||||
conn = check_pending_le_conn(hdev, bdaddr, bdaddr_type, type,
|
||||
direct_addr);
|
||||
if (conn && type == LE_ADV_IND) {
|
||||
if (!ext_adv && conn && type == LE_ADV_IND && len <= HCI_MAX_AD_LENGTH) {
|
||||
/* Store report for later inclusion by
|
||||
* mgmt_device_connected
|
||||
*/
|
||||
|
|
@ -5251,7 +5260,7 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
|
|||
* event or send an immediate device found event if the data
|
||||
* should not be stored for later.
|
||||
*/
|
||||
if (!has_pending_adv_report(hdev)) {
|
||||
if (!ext_adv && !has_pending_adv_report(hdev)) {
|
||||
/* If the report will trigger a SCAN_REQ store it for
|
||||
* later merging.
|
||||
*/
|
||||
|
|
@ -5286,7 +5295,8 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
|
|||
/* If the new report will trigger a SCAN_REQ store it for
|
||||
* later merging.
|
||||
*/
|
||||
if (type == LE_ADV_IND || type == LE_ADV_SCAN_IND) {
|
||||
if (!ext_adv && (type == LE_ADV_IND ||
|
||||
type == LE_ADV_SCAN_IND)) {
|
||||
store_pending_adv_report(hdev, bdaddr, bdaddr_type,
|
||||
rssi, flags, data, len);
|
||||
return;
|
||||
|
|
@ -5326,7 +5336,7 @@ static void hci_le_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb)
|
|||
rssi = ev->data[ev->length];
|
||||
process_adv_report(hdev, ev->evt_type, &ev->bdaddr,
|
||||
ev->bdaddr_type, NULL, 0, rssi,
|
||||
ev->data, ev->length);
|
||||
ev->data, ev->length, false);
|
||||
} else {
|
||||
bt_dev_err(hdev, "Dropping invalid advertising data");
|
||||
}
|
||||
|
|
@ -5400,7 +5410,8 @@ static void hci_le_ext_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb)
|
|||
if (legacy_evt_type != LE_ADV_INVALID) {
|
||||
process_adv_report(hdev, legacy_evt_type, &ev->bdaddr,
|
||||
ev->bdaddr_type, NULL, 0, ev->rssi,
|
||||
ev->data, ev->length);
|
||||
ev->data, ev->length,
|
||||
!(evt_type & LE_EXT_ADV_LEGACY_PDU));
|
||||
}
|
||||
|
||||
ptr += sizeof(*ev) + ev->length + 1;
|
||||
|
|
@ -5598,7 +5609,8 @@ static void hci_le_direct_adv_report_evt(struct hci_dev *hdev,
|
|||
|
||||
process_adv_report(hdev, ev->evt_type, &ev->bdaddr,
|
||||
ev->bdaddr_type, &ev->direct_addr,
|
||||
ev->direct_addr_type, ev->rssi, NULL, 0);
|
||||
ev->direct_addr_type, ev->rssi, NULL, 0,
|
||||
false);
|
||||
|
||||
ptr += sizeof(*ev);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2011,6 +2011,7 @@ static int ieee80211_leave_mesh(struct wiphy *wiphy, struct net_device *dev)
|
|||
ieee80211_stop_mesh(sdata);
|
||||
mutex_lock(&sdata->local->mtx);
|
||||
ieee80211_vif_release_channel(sdata);
|
||||
kfree(sdata->u.mesh.ie);
|
||||
mutex_unlock(&sdata->local->mtx);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -532,6 +532,7 @@ static void mesh_path_free_rcu(struct mesh_table *tbl,
|
|||
del_timer_sync(&mpath->timer);
|
||||
atomic_dec(&sdata->u.mesh.mpaths);
|
||||
atomic_dec(&tbl->entries);
|
||||
mesh_path_flush_pending(mpath);
|
||||
kfree_rcu(mpath, rcu);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -455,12 +455,13 @@ static int rds_still_queued(struct rds_sock *rs, struct rds_incoming *inc,
|
|||
int rds_notify_queue_get(struct rds_sock *rs, struct msghdr *msghdr)
|
||||
{
|
||||
struct rds_notifier *notifier;
|
||||
struct rds_rdma_notify cmsg = { 0 }; /* fill holes with zero */
|
||||
struct rds_rdma_notify cmsg;
|
||||
unsigned int count = 0, max_messages = ~0U;
|
||||
unsigned long flags;
|
||||
LIST_HEAD(copy);
|
||||
int err = 0;
|
||||
|
||||
memset(&cmsg, 0, sizeof(cmsg)); /* fill holes with zero */
|
||||
|
||||
/* put_cmsg copies to user space and thus may sleep. We can't do this
|
||||
* with rs_lock held, so first grab as many notifications as we can stuff
|
||||
|
|
|
|||
|
|
@ -1931,7 +1931,10 @@ static int sctp_sendmsg_to_asoc(struct sctp_association *asoc,
|
|||
if (sctp_wspace(asoc) < (int)msg_len)
|
||||
sctp_prsctp_prune(asoc, sinfo, msg_len - sctp_wspace(asoc));
|
||||
|
||||
if (sctp_wspace(asoc) <= 0) {
|
||||
if (sk_under_memory_pressure(sk))
|
||||
sk_mem_reclaim(sk);
|
||||
|
||||
if (sctp_wspace(asoc) <= 0 || !sk_wmem_schedule(sk, msg_len)) {
|
||||
timeo = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT);
|
||||
err = sctp_wait_for_sndbuf(asoc, &timeo, msg_len);
|
||||
if (err)
|
||||
|
|
@ -8515,7 +8518,10 @@ static int sctp_wait_for_sndbuf(struct sctp_association *asoc, long *timeo_p,
|
|||
goto do_error;
|
||||
if (signal_pending(current))
|
||||
goto do_interrupted;
|
||||
if ((int)msg_len <= sctp_wspace(asoc))
|
||||
if (sk_under_memory_pressure(sk))
|
||||
sk_mem_reclaim(sk);
|
||||
if ((int)msg_len <= sctp_wspace(asoc) &&
|
||||
sk_wmem_schedule(sk, msg_len))
|
||||
break;
|
||||
|
||||
/* Let another process have a go. Since we are going
|
||||
|
|
|
|||
|
|
@ -362,6 +362,12 @@ void x25_disconnect(struct sock *sk, int reason, unsigned char cause,
|
|||
sk->sk_state_change(sk);
|
||||
sock_set_flag(sk, SOCK_DEAD);
|
||||
}
|
||||
if (x25->neighbour) {
|
||||
read_lock_bh(&x25_list_lock);
|
||||
x25_neigh_put(x25->neighbour);
|
||||
x25->neighbour = NULL;
|
||||
read_unlock_bh(&x25_list_lock);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -364,7 +364,8 @@ static int test_datapath(uint16_t typeflags, int port_off,
|
|||
int fds[2], fds_udp[2][2], ret;
|
||||
|
||||
fprintf(stderr, "\ntest: datapath 0x%hx ports %hu,%hu\n",
|
||||
typeflags, PORT_BASE, PORT_BASE + port_off);
|
||||
typeflags, (uint16_t)PORT_BASE,
|
||||
(uint16_t)(PORT_BASE + port_off));
|
||||
|
||||
fds[0] = sock_fanout_open(typeflags, 0);
|
||||
fds[1] = sock_fanout_open(typeflags, 0);
|
||||
|
|
|
|||
|
|
@ -328,8 +328,7 @@ int main(int argc, char **argv)
|
|||
bool all_tests = true;
|
||||
int arg_index = 0;
|
||||
int failures = 0;
|
||||
int s, t;
|
||||
char opt;
|
||||
int s, t, opt;
|
||||
|
||||
while ((opt = getopt_long(argc, argv, "", long_options,
|
||||
&arg_index)) != -1) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user