mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-24 19:40:21 +09:00
Merge tag 'v4.9.272' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-4.9.y
This is the 4.9.272 stable release Change-Id: Icf7ac1d62107209b262bcf70d8c4af5c9690184e
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,6 +1,6 @@
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 9
|
||||
SUBLEVEL = 271
|
||||
SUBLEVEL = 272
|
||||
EXTRAVERSION =
|
||||
NAME = Roaring Lionus
|
||||
|
||||
|
||||
@@ -623,14 +623,6 @@ asmlinkage long do_ni_syscall(struct pt_regs *regs)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (show_unhandled_signals_ratelimited()) {
|
||||
pr_info("%s[%d]: syscall %d\n", current->comm,
|
||||
task_pid_nr(current), (int)regs->syscallno);
|
||||
dump_instr("", regs);
|
||||
if (user_mode(regs))
|
||||
__show_regs(regs);
|
||||
}
|
||||
|
||||
return sys_ni_syscall();
|
||||
}
|
||||
|
||||
|
||||
@@ -3412,7 +3412,7 @@ static int cr_interception(struct vcpu_svm *svm)
|
||||
err = 0;
|
||||
if (cr >= 16) { /* mov to cr */
|
||||
cr -= 16;
|
||||
val = kvm_register_read(&svm->vcpu, reg);
|
||||
val = kvm_register_readl(&svm->vcpu, reg);
|
||||
switch (cr) {
|
||||
case 0:
|
||||
if (!check_selective_cr0_intercepted(svm, val))
|
||||
@@ -3457,7 +3457,7 @@ static int cr_interception(struct vcpu_svm *svm)
|
||||
kvm_queue_exception(&svm->vcpu, UD_VECTOR);
|
||||
return 1;
|
||||
}
|
||||
kvm_register_write(&svm->vcpu, reg, val);
|
||||
kvm_register_writel(&svm->vcpu, reg, val);
|
||||
}
|
||||
kvm_complete_insn_gp(&svm->vcpu, err);
|
||||
|
||||
@@ -3489,13 +3489,13 @@ static int dr_interception(struct vcpu_svm *svm)
|
||||
if (dr >= 16) { /* mov to DRn */
|
||||
if (!kvm_require_dr(&svm->vcpu, dr - 16))
|
||||
return 1;
|
||||
val = kvm_register_read(&svm->vcpu, reg);
|
||||
val = kvm_register_readl(&svm->vcpu, reg);
|
||||
kvm_set_dr(&svm->vcpu, dr - 16, val);
|
||||
} else {
|
||||
if (!kvm_require_dr(&svm->vcpu, dr))
|
||||
return 1;
|
||||
kvm_get_dr(&svm->vcpu, dr, &val);
|
||||
kvm_register_write(&svm->vcpu, reg, val);
|
||||
kvm_register_writel(&svm->vcpu, reg, val);
|
||||
}
|
||||
|
||||
skip_emulated_instruction(&svm->vcpu);
|
||||
|
||||
@@ -257,8 +257,7 @@ static int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg)
|
||||
if (!msg || !(mem->validation_bits & CPER_MEM_VALID_MODULE_HANDLE))
|
||||
return 0;
|
||||
|
||||
n = 0;
|
||||
len = CPER_REC_LEN - 1;
|
||||
len = CPER_REC_LEN;
|
||||
dmi_memdev_name(mem->mem_dev_handle, &bank, &device);
|
||||
if (bank && device)
|
||||
n = snprintf(msg, len, "DIMM location: %s %s ", bank, device);
|
||||
@@ -267,7 +266,6 @@ static int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg)
|
||||
"DIMM location: not present. DMI handle: 0x%.4x ",
|
||||
mem->mem_dev_handle);
|
||||
|
||||
msg[n] = '\0';
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,11 +68,6 @@ static bool entry_is_valid(const efi_memory_desc_t *in, efi_memory_desc_t *out)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(in->attribute & (EFI_MEMORY_RO | EFI_MEMORY_XP))) {
|
||||
pr_warn("Entry attributes invalid: RO and XP bits both cleared\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (PAGE_SIZE > EFI_PAGE_SIZE &&
|
||||
(!PAGE_ALIGNED(in->phys_addr) ||
|
||||
!PAGE_ALIGNED(in->num_pages << EFI_PAGE_SHIFT))) {
|
||||
|
||||
@@ -1157,8 +1157,8 @@ static int i2c_hid_probe(struct i2c_client *client,
|
||||
hid->vendor = le16_to_cpu(ihid->hdesc.wVendorID);
|
||||
hid->product = le16_to_cpu(ihid->hdesc.wProductID);
|
||||
|
||||
snprintf(hid->name, sizeof(hid->name), "%s %04hX:%04hX",
|
||||
client->name, hid->vendor, hid->product);
|
||||
snprintf(hid->name, sizeof(hid->name), "%s %04X:%04X",
|
||||
client->name, (u16)hid->vendor, (u16)hid->product);
|
||||
strlcpy(hid->phys, dev_name(&client->dev), sizeof(hid->phys));
|
||||
|
||||
ihid->quirks = i2c_hid_lookup_quirk(hid->vendor, hid->product);
|
||||
|
||||
@@ -1304,6 +1304,7 @@ int hid_pidff_init(struct hid_device *hid)
|
||||
|
||||
if (pidff->pool[PID_DEVICE_MANAGED_POOL].value &&
|
||||
pidff->pool[PID_DEVICE_MANAGED_POOL].value[0] == 0) {
|
||||
error = -EPERM;
|
||||
hid_notice(hid,
|
||||
"device does not support device managed pool\n");
|
||||
goto fail;
|
||||
|
||||
@@ -4262,7 +4262,6 @@ int bnxt_hwrm_func_qcaps(struct bnxt *bp)
|
||||
|
||||
pf->fw_fid = le16_to_cpu(resp->fid);
|
||||
pf->port_id = le16_to_cpu(resp->port_id);
|
||||
bp->dev->dev_port = pf->port_id;
|
||||
memcpy(pf->mac_addr, resp->mac_address, ETH_ALEN);
|
||||
memcpy(bp->dev->dev_addr, pf->mac_addr, ETH_ALEN);
|
||||
pf->max_rsscos_ctxs = le16_to_cpu(resp->max_rsscos_ctx);
|
||||
|
||||
@@ -1563,6 +1563,15 @@ cdc_ncm_speed_change(struct usbnet *dev,
|
||||
uint32_t rx_speed = le32_to_cpu(data->DLBitRRate);
|
||||
uint32_t tx_speed = le32_to_cpu(data->ULBitRate);
|
||||
|
||||
/* if the speed hasn't changed, don't report it.
|
||||
* RTL8156 shipped before 2021 sends notification about every 32ms.
|
||||
*/
|
||||
if (dev->rx_speed == rx_speed && dev->tx_speed == tx_speed)
|
||||
return;
|
||||
|
||||
dev->rx_speed = rx_speed;
|
||||
dev->tx_speed = tx_speed;
|
||||
|
||||
/*
|
||||
* Currently the USB-NET API does not support reporting the actual
|
||||
* device speed. Do print it instead.
|
||||
@@ -1606,7 +1615,8 @@ static void cdc_ncm_status(struct usbnet *dev, struct urb *urb)
|
||||
* USB_CDC_NOTIFY_NETWORK_CONNECTION notification shall be
|
||||
* sent by device after USB_CDC_NOTIFY_SPEED_CHANGE.
|
||||
*/
|
||||
usbnet_link_change(dev, !!event->wValue, 0);
|
||||
if (netif_carrier_ok(dev->net) != !!event->wValue)
|
||||
usbnet_link_change(dev, !!event->wValue, 0);
|
||||
break;
|
||||
|
||||
case USB_CDC_NOTIFY_SPEED_CHANGE:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
config VFIO_PCI
|
||||
tristate "VFIO support for PCI devices"
|
||||
depends on VFIO && PCI && EVENTFD
|
||||
depends on MMU
|
||||
select VFIO_VIRQFD
|
||||
select IRQ_BYPASS_MANAGER
|
||||
help
|
||||
|
||||
@@ -1576,7 +1576,7 @@ static int vfio_ecap_init(struct vfio_pci_device *vdev)
|
||||
if (len == 0xFF) {
|
||||
len = vfio_ext_cap_len(vdev, ecap, epos);
|
||||
if (len < 0)
|
||||
return ret;
|
||||
return len;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@ err_irq:
|
||||
vfio_platform_regions_cleanup(vdev);
|
||||
err_reg:
|
||||
mutex_unlock(&driver_lock);
|
||||
module_put(THIS_MODULE);
|
||||
module_put(vdev->parent_module);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
|
||||
struct pci_dev *dev, int devid,
|
||||
publish_pci_dev_cb publish_cb)
|
||||
{
|
||||
int err = 0, slot, func = -1;
|
||||
int err = 0, slot, func = PCI_FUNC(dev->devfn);
|
||||
struct pci_dev_entry *t, *dev_entry;
|
||||
struct vpci_dev_data *vpci_dev = pdev->pci_dev_data;
|
||||
|
||||
@@ -93,23 +93,26 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
|
||||
|
||||
/*
|
||||
* Keep multi-function devices together on the virtual PCI bus, except
|
||||
* virtual functions.
|
||||
* that we want to keep virtual functions at func 0 on their own. They
|
||||
* aren't multi-function devices and hence their presence at func 0
|
||||
* may cause guests to not scan the other functions.
|
||||
*/
|
||||
if (!dev->is_virtfn) {
|
||||
if (!dev->is_virtfn || func) {
|
||||
for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
|
||||
if (list_empty(&vpci_dev->dev_list[slot]))
|
||||
continue;
|
||||
|
||||
t = list_entry(list_first(&vpci_dev->dev_list[slot]),
|
||||
struct pci_dev_entry, list);
|
||||
if (t->dev->is_virtfn && !PCI_FUNC(t->dev->devfn))
|
||||
continue;
|
||||
|
||||
if (match_slot(dev, t->dev)) {
|
||||
pr_info("vpci: %s: assign to virtual slot %d func %d\n",
|
||||
pci_name(dev), slot,
|
||||
PCI_FUNC(dev->devfn));
|
||||
func);
|
||||
list_add_tail(&dev_entry->list,
|
||||
&vpci_dev->dev_list[slot]);
|
||||
func = PCI_FUNC(dev->devfn);
|
||||
goto unlock;
|
||||
}
|
||||
}
|
||||
@@ -122,7 +125,6 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
|
||||
pci_name(dev), slot);
|
||||
list_add_tail(&dev_entry->list,
|
||||
&vpci_dev->dev_list[slot]);
|
||||
func = dev->is_virtfn ? 0 : PCI_FUNC(dev->devfn);
|
||||
goto unlock;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -608,7 +608,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
|
||||
u64 end_byte = bytenr + len;
|
||||
u64 csum_end;
|
||||
struct extent_buffer *leaf;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
u16 csum_size = btrfs_super_csum_size(root->fs_info->super_copy);
|
||||
int blocksize_bits = root->fs_info->sb->s_blocksize_bits;
|
||||
|
||||
@@ -626,6 +626,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
|
||||
path->leave_spinning = 1;
|
||||
ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
|
||||
if (ret > 0) {
|
||||
ret = 0;
|
||||
if (path->slots[0] == 0)
|
||||
break;
|
||||
path->slots[0]--;
|
||||
@@ -656,7 +657,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
|
||||
if (key.offset >= bytenr && csum_end <= end_byte) {
|
||||
ret = btrfs_del_item(trans, root, path);
|
||||
if (ret)
|
||||
goto out;
|
||||
break;
|
||||
if (key.offset == bytenr)
|
||||
break;
|
||||
} else if (key.offset < bytenr && csum_end > end_byte) {
|
||||
@@ -700,8 +701,9 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
|
||||
ret = btrfs_split_item(trans, root, path, &key, offset);
|
||||
if (ret && ret != -EAGAIN) {
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
goto out;
|
||||
break;
|
||||
}
|
||||
ret = 0;
|
||||
|
||||
key.offset = end_byte - 1;
|
||||
} else {
|
||||
@@ -711,8 +713,6 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
|
||||
}
|
||||
btrfs_release_path(path);
|
||||
}
|
||||
ret = 0;
|
||||
out:
|
||||
btrfs_free_path(path);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1529,6 +1529,7 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans,
|
||||
break;
|
||||
|
||||
if (ret == 1) {
|
||||
ret = 0;
|
||||
if (path->slots[0] == 0)
|
||||
break;
|
||||
path->slots[0]--;
|
||||
@@ -1541,17 +1542,19 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans,
|
||||
|
||||
ret = btrfs_del_item(trans, root, path);
|
||||
if (ret)
|
||||
goto out;
|
||||
break;
|
||||
|
||||
btrfs_release_path(path);
|
||||
inode = read_one_inode(root, key.offset);
|
||||
if (!inode)
|
||||
return -EIO;
|
||||
if (!inode) {
|
||||
ret = -EIO;
|
||||
break;
|
||||
}
|
||||
|
||||
ret = fixup_inode_link_count(trans, root, inode);
|
||||
iput(inode);
|
||||
if (ret)
|
||||
goto out;
|
||||
break;
|
||||
|
||||
/*
|
||||
* fixup on a directory may create new entries,
|
||||
@@ -1560,8 +1563,6 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans,
|
||||
*/
|
||||
key.offset = (u64)-1;
|
||||
}
|
||||
ret = 0;
|
||||
out:
|
||||
btrfs_release_path(path);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -3274,7 +3274,10 @@ static int ext4_split_extent_at(handle_t *handle,
|
||||
ext4_ext_mark_unwritten(ex2);
|
||||
|
||||
err = ext4_ext_insert_extent(handle, inode, ppath, &newex, flags);
|
||||
if (err == -ENOSPC && (EXT4_EXT_MAY_ZEROOUT & split_flag)) {
|
||||
if (err != -ENOSPC && err != -EDQUOT)
|
||||
goto out;
|
||||
|
||||
if (EXT4_EXT_MAY_ZEROOUT & split_flag) {
|
||||
if (split_flag & (EXT4_EXT_DATA_VALID1|EXT4_EXT_DATA_VALID2)) {
|
||||
if (split_flag & EXT4_EXT_DATA_VALID1) {
|
||||
err = ext4_ext_zeroout(inode, ex2);
|
||||
@@ -3300,30 +3303,30 @@ static int ext4_split_extent_at(handle_t *handle,
|
||||
ext4_ext_pblock(&orig_ex));
|
||||
}
|
||||
|
||||
if (err)
|
||||
goto fix_extent_len;
|
||||
/* update the extent length and mark as initialized */
|
||||
ex->ee_len = cpu_to_le16(ee_len);
|
||||
ext4_ext_try_to_merge(handle, inode, path, ex);
|
||||
err = ext4_ext_dirty(handle, inode, path + path->p_depth);
|
||||
if (err)
|
||||
goto fix_extent_len;
|
||||
|
||||
/* update extent status tree */
|
||||
err = ext4_zeroout_es(inode, &zero_ex);
|
||||
|
||||
goto out;
|
||||
} else if (err)
|
||||
goto fix_extent_len;
|
||||
|
||||
out:
|
||||
ext4_ext_show_leaf(inode, path);
|
||||
return err;
|
||||
if (!err) {
|
||||
/* update the extent length and mark as initialized */
|
||||
ex->ee_len = cpu_to_le16(ee_len);
|
||||
ext4_ext_try_to_merge(handle, inode, path, ex);
|
||||
err = ext4_ext_dirty(handle, inode, path + path->p_depth);
|
||||
if (!err)
|
||||
/* update extent status tree */
|
||||
err = ext4_zeroout_es(inode, &zero_ex);
|
||||
/* If we failed at this point, we don't know in which
|
||||
* state the extent tree exactly is so don't try to fix
|
||||
* length of the original extent as it may do even more
|
||||
* damage.
|
||||
*/
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
fix_extent_len:
|
||||
ex->ee_len = orig_ex.ee_len;
|
||||
ext4_ext_dirty(handle, inode, path + path->p_depth);
|
||||
return err;
|
||||
out:
|
||||
ext4_ext_show_leaf(inode, path);
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1838,6 +1838,45 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* zero out partial blocks of one cluster.
|
||||
*
|
||||
* start: file offset where zero starts, will be made upper block aligned.
|
||||
* len: it will be trimmed to the end of current cluster if "start + len"
|
||||
* is bigger than it.
|
||||
*/
|
||||
static int ocfs2_zeroout_partial_cluster(struct inode *inode,
|
||||
u64 start, u64 len)
|
||||
{
|
||||
int ret;
|
||||
u64 start_block, end_block, nr_blocks;
|
||||
u64 p_block, offset;
|
||||
u32 cluster, p_cluster, nr_clusters;
|
||||
struct super_block *sb = inode->i_sb;
|
||||
u64 end = ocfs2_align_bytes_to_clusters(sb, start);
|
||||
|
||||
if (start + len < end)
|
||||
end = start + len;
|
||||
|
||||
start_block = ocfs2_blocks_for_bytes(sb, start);
|
||||
end_block = ocfs2_blocks_for_bytes(sb, end);
|
||||
nr_blocks = end_block - start_block;
|
||||
if (!nr_blocks)
|
||||
return 0;
|
||||
|
||||
cluster = ocfs2_bytes_to_clusters(sb, start);
|
||||
ret = ocfs2_get_clusters(inode, cluster, &p_cluster,
|
||||
&nr_clusters, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (!p_cluster)
|
||||
return 0;
|
||||
|
||||
offset = start_block - ocfs2_clusters_to_blocks(sb, cluster);
|
||||
p_block = ocfs2_clusters_to_blocks(sb, p_cluster) + offset;
|
||||
return sb_issue_zeroout(sb, p_block, nr_blocks, GFP_NOFS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Parts of this function taken from xfs_change_file_space()
|
||||
*/
|
||||
@@ -1848,7 +1887,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
|
||||
{
|
||||
int ret;
|
||||
s64 llen;
|
||||
loff_t size;
|
||||
loff_t size, orig_isize;
|
||||
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
|
||||
struct buffer_head *di_bh = NULL;
|
||||
handle_t *handle;
|
||||
@@ -1879,6 +1918,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
|
||||
goto out_inode_unlock;
|
||||
}
|
||||
|
||||
orig_isize = i_size_read(inode);
|
||||
switch (sr->l_whence) {
|
||||
case 0: /*SEEK_SET*/
|
||||
break;
|
||||
@@ -1886,7 +1926,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
|
||||
sr->l_start += f_pos;
|
||||
break;
|
||||
case 2: /*SEEK_END*/
|
||||
sr->l_start += i_size_read(inode);
|
||||
sr->l_start += orig_isize;
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
@@ -1940,6 +1980,14 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
/* zeroout eof blocks in the cluster. */
|
||||
if (!ret && change_size && orig_isize < size) {
|
||||
ret = ocfs2_zeroout_partial_cluster(inode, orig_isize,
|
||||
size - orig_isize);
|
||||
if (!ret)
|
||||
i_size_write(inode, size);
|
||||
}
|
||||
up_write(&OCFS2_I(inode)->ip_alloc_sem);
|
||||
if (ret) {
|
||||
mlog_errno(ret);
|
||||
@@ -1956,9 +2004,6 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
|
||||
goto out_inode_unlock;
|
||||
}
|
||||
|
||||
if (change_size && i_size_read(inode) < size)
|
||||
i_size_write(inode, size);
|
||||
|
||||
inode->i_ctime = inode->i_mtime = current_time(inode);
|
||||
ret = ocfs2_mark_inode_dirty(handle, inode, di_bh);
|
||||
if (ret < 0)
|
||||
|
||||
@@ -80,6 +80,8 @@ struct usbnet {
|
||||
# define EVENT_LINK_CHANGE 11
|
||||
# define EVENT_SET_RX_MODE 12
|
||||
# define EVENT_NO_IP_ALIGN 13
|
||||
u32 rx_speed; /* in bps - NOT Mbps */
|
||||
u32 tx_speed; /* in bps - NOT Mbps */
|
||||
};
|
||||
|
||||
static inline struct usb_driver *driver_of(struct usb_interface *intf)
|
||||
|
||||
@@ -119,7 +119,7 @@ void caif_free_client(struct cflayer *adap_layer);
|
||||
* The link_support layer is used to add any Link Layer specific
|
||||
* framing.
|
||||
*/
|
||||
void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
|
||||
int caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
|
||||
struct cflayer *link_support, int head_room,
|
||||
struct cflayer **layer, int (**rcv_func)(
|
||||
struct sk_buff *, struct net_device *,
|
||||
|
||||
@@ -62,7 +62,7 @@ void cfcnfg_remove(struct cfcnfg *cfg);
|
||||
* @fcs: Specify if checksum is used in CAIF Framing Layer.
|
||||
* @head_room: Head space needed by link specific protocol.
|
||||
*/
|
||||
void
|
||||
int
|
||||
cfcnfg_add_phy_layer(struct cfcnfg *cnfg,
|
||||
struct net_device *dev, struct cflayer *phy_layer,
|
||||
enum cfcnfg_phy_preference pref,
|
||||
|
||||
@@ -9,4 +9,5 @@
|
||||
#include <net/caif/caif_layer.h>
|
||||
|
||||
struct cflayer *cfserl_create(int instance, bool use_stx);
|
||||
void cfserl_release(struct cflayer *layer);
|
||||
#endif
|
||||
|
||||
@@ -1012,7 +1012,7 @@ static noinline void __init kernel_init_freeable(void)
|
||||
*/
|
||||
set_cpus_allowed_ptr(current, cpu_all_mask);
|
||||
|
||||
cad_pid = task_pid(current);
|
||||
cad_pid = get_pid(task_pid(current));
|
||||
|
||||
smp_prepare_cpus(setup_max_cpus);
|
||||
|
||||
|
||||
@@ -1422,8 +1422,13 @@ static int hci_dev_do_open(struct hci_dev *hdev)
|
||||
} else {
|
||||
/* Init failed, cleanup */
|
||||
flush_work(&hdev->tx_work);
|
||||
flush_work(&hdev->cmd_work);
|
||||
|
||||
/* Since hci_rx_work() is possible to awake new cmd_work
|
||||
* it should be flushed first to avoid unexpected call of
|
||||
* hci_cmd_work()
|
||||
*/
|
||||
flush_work(&hdev->rx_work);
|
||||
flush_work(&hdev->cmd_work);
|
||||
|
||||
skb_queue_purge(&hdev->cmd_q);
|
||||
skb_queue_purge(&hdev->rx_q);
|
||||
|
||||
@@ -750,7 +750,7 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event)
|
||||
/* Detach sockets from device */
|
||||
read_lock(&hci_sk_list.lock);
|
||||
sk_for_each(sk, &hci_sk_list.head) {
|
||||
bh_lock_sock_nested(sk);
|
||||
lock_sock(sk);
|
||||
if (hci_pi(sk)->hdev == hdev) {
|
||||
hci_pi(sk)->hdev = NULL;
|
||||
sk->sk_err = EPIPE;
|
||||
@@ -759,7 +759,7 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event)
|
||||
|
||||
hci_dev_put(hdev);
|
||||
}
|
||||
bh_unlock_sock(sk);
|
||||
release_sock(sk);
|
||||
}
|
||||
read_unlock(&hci_sk_list.lock);
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ static void dev_flowctrl(struct net_device *dev, int on)
|
||||
caifd_put(caifd);
|
||||
}
|
||||
|
||||
void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
|
||||
int caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
|
||||
struct cflayer *link_support, int head_room,
|
||||
struct cflayer **layer,
|
||||
int (**rcv_func)(struct sk_buff *, struct net_device *,
|
||||
@@ -314,11 +314,12 @@ void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
|
||||
enum cfcnfg_phy_preference pref;
|
||||
struct cfcnfg *cfg = get_cfcnfg(dev_net(dev));
|
||||
struct caif_device_entry_list *caifdevs;
|
||||
int res;
|
||||
|
||||
caifdevs = caif_device_list(dev_net(dev));
|
||||
caifd = caif_device_alloc(dev);
|
||||
if (!caifd)
|
||||
return;
|
||||
return -ENOMEM;
|
||||
*layer = &caifd->layer;
|
||||
spin_lock_init(&caifd->flow_lock);
|
||||
|
||||
@@ -340,7 +341,7 @@ void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
|
||||
sizeof(caifd->layer.name) - 1);
|
||||
caifd->layer.name[sizeof(caifd->layer.name) - 1] = 0;
|
||||
caifd->layer.transmit = transmit;
|
||||
cfcnfg_add_phy_layer(cfg,
|
||||
res = cfcnfg_add_phy_layer(cfg,
|
||||
dev,
|
||||
&caifd->layer,
|
||||
pref,
|
||||
@@ -350,6 +351,7 @@ void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
|
||||
mutex_unlock(&caifdevs->lock);
|
||||
if (rcv_func)
|
||||
*rcv_func = receive;
|
||||
return res;
|
||||
}
|
||||
EXPORT_SYMBOL(caif_enroll_dev);
|
||||
|
||||
@@ -364,6 +366,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
|
||||
struct cflayer *layer, *link_support;
|
||||
int head_room = 0;
|
||||
struct caif_device_entry_list *caifdevs;
|
||||
int res;
|
||||
|
||||
cfg = get_cfcnfg(dev_net(dev));
|
||||
caifdevs = caif_device_list(dev_net(dev));
|
||||
@@ -389,8 +392,10 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
|
||||
break;
|
||||
}
|
||||
}
|
||||
caif_enroll_dev(dev, caifdev, link_support, head_room,
|
||||
res = caif_enroll_dev(dev, caifdev, link_support, head_room,
|
||||
&layer, NULL);
|
||||
if (res)
|
||||
cfserl_release(link_support);
|
||||
caifdev->flowctrl = dev_flowctrl;
|
||||
break;
|
||||
|
||||
|
||||
@@ -116,6 +116,11 @@ static struct cflayer *cfusbl_create(int phyid, u8 ethaddr[ETH_ALEN],
|
||||
return (struct cflayer *) this;
|
||||
}
|
||||
|
||||
static void cfusbl_release(struct cflayer *layer)
|
||||
{
|
||||
kfree(layer);
|
||||
}
|
||||
|
||||
static struct packet_type caif_usb_type __read_mostly = {
|
||||
.type = cpu_to_be16(ETH_P_802_EX1),
|
||||
};
|
||||
@@ -128,6 +133,7 @@ static int cfusbl_device_notify(struct notifier_block *me, unsigned long what,
|
||||
struct cflayer *layer, *link_support;
|
||||
struct usbnet *usbnet;
|
||||
struct usb_device *usbdev;
|
||||
int res;
|
||||
|
||||
/* Check whether we have a NCM device, and find its VID/PID. */
|
||||
if (!(dev->dev.parent && dev->dev.parent->driver &&
|
||||
@@ -170,8 +176,11 @@ static int cfusbl_device_notify(struct notifier_block *me, unsigned long what,
|
||||
if (dev->num_tx_queues > 1)
|
||||
pr_warn("USB device uses more than one tx queue\n");
|
||||
|
||||
caif_enroll_dev(dev, &common, link_support, CFUSB_MAX_HEADLEN,
|
||||
res = caif_enroll_dev(dev, &common, link_support, CFUSB_MAX_HEADLEN,
|
||||
&layer, &caif_usb_type.func);
|
||||
if (res)
|
||||
goto err;
|
||||
|
||||
if (!pack_added)
|
||||
dev_add_pack(&caif_usb_type);
|
||||
pack_added = true;
|
||||
@@ -181,6 +190,9 @@ static int cfusbl_device_notify(struct notifier_block *me, unsigned long what,
|
||||
layer->name[sizeof(layer->name) - 1] = 0;
|
||||
|
||||
return 0;
|
||||
err:
|
||||
cfusbl_release(link_support);
|
||||
return res;
|
||||
}
|
||||
|
||||
static struct notifier_block caif_device_notifier = {
|
||||
|
||||
@@ -455,7 +455,7 @@ unlock:
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
cfcnfg_add_phy_layer(struct cfcnfg *cnfg,
|
||||
struct net_device *dev, struct cflayer *phy_layer,
|
||||
enum cfcnfg_phy_preference pref,
|
||||
@@ -464,7 +464,7 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg,
|
||||
{
|
||||
struct cflayer *frml;
|
||||
struct cfcnfg_phyinfo *phyinfo = NULL;
|
||||
int i;
|
||||
int i, res = 0;
|
||||
u8 phyid;
|
||||
|
||||
mutex_lock(&cnfg->lock);
|
||||
@@ -478,12 +478,15 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg,
|
||||
goto got_phyid;
|
||||
}
|
||||
pr_warn("Too many CAIF Link Layers (max 6)\n");
|
||||
res = -EEXIST;
|
||||
goto out;
|
||||
|
||||
got_phyid:
|
||||
phyinfo = kzalloc(sizeof(struct cfcnfg_phyinfo), GFP_ATOMIC);
|
||||
if (!phyinfo)
|
||||
if (!phyinfo) {
|
||||
res = -ENOMEM;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
phy_layer->id = phyid;
|
||||
phyinfo->pref = pref;
|
||||
@@ -497,8 +500,10 @@ got_phyid:
|
||||
|
||||
frml = cffrml_create(phyid, fcs);
|
||||
|
||||
if (!frml)
|
||||
if (!frml) {
|
||||
res = -ENOMEM;
|
||||
goto out_err;
|
||||
}
|
||||
phyinfo->frm_layer = frml;
|
||||
layer_set_up(frml, cnfg->mux);
|
||||
|
||||
@@ -516,11 +521,12 @@ got_phyid:
|
||||
list_add_rcu(&phyinfo->node, &cnfg->phys);
|
||||
out:
|
||||
mutex_unlock(&cnfg->lock);
|
||||
return;
|
||||
return res;
|
||||
|
||||
out_err:
|
||||
kfree(phyinfo);
|
||||
mutex_unlock(&cnfg->lock);
|
||||
return res;
|
||||
}
|
||||
EXPORT_SYMBOL(cfcnfg_add_phy_layer);
|
||||
|
||||
|
||||
@@ -31,6 +31,11 @@ static int cfserl_transmit(struct cflayer *layr, struct cfpkt *pkt);
|
||||
static void cfserl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl,
|
||||
int phyid);
|
||||
|
||||
void cfserl_release(struct cflayer *layer)
|
||||
{
|
||||
kfree(layer);
|
||||
}
|
||||
|
||||
struct cflayer *cfserl_create(int instance, bool use_stx)
|
||||
{
|
||||
struct cfserl *this = kzalloc(sizeof(struct cfserl), GFP_ATOMIC);
|
||||
|
||||
@@ -688,8 +688,10 @@ int ieee802154_llsec_getparams(struct sk_buff *skb, struct genl_info *info)
|
||||
nla_put_u8(msg, IEEE802154_ATTR_LLSEC_SECLEVEL, params.out_level) ||
|
||||
nla_put_u32(msg, IEEE802154_ATTR_LLSEC_FRAME_COUNTER,
|
||||
be32_to_cpu(params.frame_counter)) ||
|
||||
ieee802154_llsec_fill_key_id(msg, ¶ms.out_key))
|
||||
ieee802154_llsec_fill_key_id(msg, ¶ms.out_key)) {
|
||||
rc = -ENOBUFS;
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
dev_put(dev);
|
||||
|
||||
|
||||
@@ -249,8 +249,10 @@ int ieee802154_add_iface(struct sk_buff *skb, struct genl_info *info)
|
||||
}
|
||||
|
||||
if (nla_put_string(msg, IEEE802154_ATTR_PHY_NAME, wpan_phy_name(phy)) ||
|
||||
nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name))
|
||||
nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name)) {
|
||||
rc = -EMSGSIZE;
|
||||
goto nla_put_failure;
|
||||
}
|
||||
dev_put(dev);
|
||||
|
||||
wpan_phy_put(phy);
|
||||
|
||||
@@ -1256,7 +1256,7 @@ ip_vs_add_service(struct netns_ipvs *ipvs, struct ip_vs_service_user_kern *u,
|
||||
ip_vs_addr_copy(svc->af, &svc->addr, &u->addr);
|
||||
svc->port = u->port;
|
||||
svc->fwmark = u->fwmark;
|
||||
svc->flags = u->flags;
|
||||
svc->flags = u->flags & ~IP_VS_SVC_F_HASHED;
|
||||
svc->timeout = u->timeout * HZ;
|
||||
svc->netmask = u->netmask;
|
||||
svc->ipvs = ipvs;
|
||||
|
||||
@@ -355,10 +355,14 @@ static int
|
||||
nfnl_cthelper_update(const struct nlattr * const tb[],
|
||||
struct nf_conntrack_helper *helper)
|
||||
{
|
||||
u32 size;
|
||||
int ret;
|
||||
|
||||
if (tb[NFCTH_PRIV_DATA_LEN])
|
||||
return -EBUSY;
|
||||
if (tb[NFCTH_PRIV_DATA_LEN]) {
|
||||
size = ntohl(nla_get_be32(tb[NFCTH_PRIV_DATA_LEN]));
|
||||
if (size != helper->data_len)
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
if (tb[NFCTH_POLICY]) {
|
||||
ret = nfnl_cthelper_update_policy(helper, tb[NFCTH_POLICY]);
|
||||
|
||||
@@ -121,6 +121,7 @@ static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
|
||||
if (!llcp_sock->service_name) {
|
||||
nfc_llcp_local_put(llcp_sock->local);
|
||||
llcp_sock->local = NULL;
|
||||
llcp_sock->dev = NULL;
|
||||
ret = -ENOMEM;
|
||||
goto put_dev;
|
||||
}
|
||||
@@ -130,6 +131,7 @@ static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
|
||||
llcp_sock->local = NULL;
|
||||
kfree(llcp_sock->service_name);
|
||||
llcp_sock->service_name = NULL;
|
||||
llcp_sock->dev = NULL;
|
||||
ret = -EADDRINUSE;
|
||||
goto put_dev;
|
||||
}
|
||||
|
||||
@@ -488,9 +488,10 @@ static void snd_timer_notify1(struct snd_timer_instance *ti, int event)
|
||||
return;
|
||||
if (timer->hw.flags & SNDRV_TIMER_HW_SLAVE)
|
||||
return;
|
||||
event += 10; /* convert to SNDRV_TIMER_EVENT_MXXX */
|
||||
list_for_each_entry(ts, &ti->slave_active_head, active_list)
|
||||
if (ts->ccallback)
|
||||
ts->ccallback(ts, event + 100, &tstamp, resolution);
|
||||
ts->ccallback(ts, event, &tstamp, resolution);
|
||||
}
|
||||
|
||||
/* start/continue a master timer */
|
||||
|
||||
Reference in New Issue
Block a user