Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1f1f073 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6:
  Staging: sep: remove driver
  Staging: batman-adv: Don't write in not allocated packet_buff
  Staging: batman-adv: Don't use net_dev after dev_put
  Staging: batman-adv: Create batman_if only on register event
  Staging: batman-adv: fix own mac address detection
  Staging: batman-adv: always reply batman icmp packets with primary mac
  Staging: batman-adv: fix batman icmp originating from secondary interface
  Staging: batman-adv: unify orig_hash_lock spinlock handling to avoid deadlocks
  Staging: batman-adv: Fix merge of linus tree
  Staging: spectra: removes unused functions
  Staging: spectra: initializa lblk variable
  Staging: spectra: removes unused variable
  Staging: spectra: remove duplicate GLOB_VERSION definition
  Staging: spectra: don't use locked_ioctl, fix build
  Staging: use new REQ_FLUSH flag, fix build breakage
  Staging: spectra: removes q->prepare_flush_fn, fix build breakage
parents 472e449c d49824c0
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -113,8 +113,6 @@ source "drivers/staging/vme/Kconfig"

source "drivers/staging/memrar/Kconfig"

source "drivers/staging/sep/Kconfig"

source "drivers/staging/iio/Kconfig"

source "drivers/staging/zram/Kconfig"
+0 −1
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ obj-$(CONFIG_FB_UDL) += udlfb/
obj-$(CONFIG_HYPERV)		+= hv/
obj-$(CONFIG_VME_BUS)		+= vme/
obj-$(CONFIG_MRST_RAR_HANDLER)	+= memrar/
obj-$(CONFIG_DX_SEP)		+= sep/
obj-$(CONFIG_IIO)		+= iio/
obj-$(CONFIG_ZRAM)		+= zram/
obj-$(CONFIG_WLAGS49_H2)	+= wlags49_h2/
+4 −0
Original line number Diff line number Diff line
@@ -267,6 +267,10 @@ static ssize_t store_log_level(struct kobject *kobj, struct attribute *attr,
	if (atomic_read(&bat_priv->log_level) == log_level_tmp)
		return count;

	bat_info(net_dev, "Changing log level from: %i to: %li\n",
		 atomic_read(&bat_priv->log_level),
		 log_level_tmp);

	atomic_set(&bat_priv->log_level, (unsigned)log_level_tmp);
	return count;
}
+12 −17
Original line number Diff line number Diff line
@@ -129,6 +129,9 @@ static bool hardif_is_iface_up(struct batman_if *batman_if)

static void update_mac_addresses(struct batman_if *batman_if)
{
	if (!batman_if || !batman_if->packet_buff)
		return;

	addr_to_string(batman_if->addr_str, batman_if->net_dev->dev_addr);

	memcpy(((struct batman_packet *)(batman_if->packet_buff))->orig,
@@ -194,8 +197,6 @@ static void hardif_activate_interface(struct net_device *net_dev,
	if (batman_if->if_status != IF_INACTIVE)
		return;

	dev_hold(batman_if->net_dev);

	update_mac_addresses(batman_if);
	batman_if->if_status = IF_TO_BE_ACTIVATED;

@@ -222,8 +223,6 @@ static void hardif_deactivate_interface(struct net_device *net_dev,
	   (batman_if->if_status != IF_TO_BE_ACTIVATED))
		return;

	dev_put(batman_if->net_dev);

	batman_if->if_status = IF_INACTIVE;

	bat_info(net_dev, "Interface deactivated: %s\n", batman_if->dev);
@@ -318,11 +317,13 @@ static struct batman_if *hardif_add_interface(struct net_device *net_dev)
	if (ret != 1)
		goto out;

	dev_hold(net_dev);

	batman_if = kmalloc(sizeof(struct batman_if), GFP_ATOMIC);
	if (!batman_if) {
		pr_err("Can't add interface (%s): out of memory\n",
		       net_dev->name);
		goto out;
		goto release_dev;
	}

	batman_if->dev = kstrdup(net_dev->name, GFP_ATOMIC);
@@ -336,6 +337,7 @@ static struct batman_if *hardif_add_interface(struct net_device *net_dev)
	batman_if->if_num = -1;
	batman_if->net_dev = net_dev;
	batman_if->if_status = IF_NOT_IN_USE;
	batman_if->packet_buff = NULL;
	INIT_LIST_HEAD(&batman_if->list);

	check_known_mac_addr(batman_if->net_dev->dev_addr);
@@ -346,6 +348,8 @@ static struct batman_if *hardif_add_interface(struct net_device *net_dev)
	kfree(batman_if->dev);
free_if:
	kfree(batman_if);
release_dev:
	dev_put(net_dev);
out:
	return NULL;
}
@@ -374,6 +378,7 @@ static void hardif_remove_interface(struct batman_if *batman_if)
	batman_if->if_status = IF_TO_BE_REMOVED;
	list_del_rcu(&batman_if->list);
	sysfs_del_hardif(&batman_if->hardif_obj);
	dev_put(batman_if->net_dev);
	call_rcu(&batman_if->rcu, hardif_free_interface);
}

@@ -393,15 +398,13 @@ static int hard_if_event(struct notifier_block *this,
	/* FIXME: each batman_if will be attached to a softif */
	struct bat_priv *bat_priv = netdev_priv(soft_device);

	if (!batman_if)
	if (!batman_if && event == NETDEV_REGISTER)
			batman_if = hardif_add_interface(net_dev);

	if (!batman_if)
		goto out;

	switch (event) {
	case NETDEV_REGISTER:
		break;
	case NETDEV_UP:
		hardif_activate_interface(soft_device, bat_priv, batman_if);
		break;
@@ -442,8 +445,6 @@ int batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
	struct bat_priv *bat_priv = netdev_priv(soft_device);
	struct batman_packet *batman_packet;
	struct batman_if *batman_if;
	struct net_device_stats *stats;
	struct rtnl_link_stats64 temp;
	int ret;

	skb = skb_share_check(skb, GFP_ATOMIC);
@@ -479,12 +480,6 @@ int batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
	if (batman_if->if_status != IF_ACTIVE)
		goto err_free;

	stats = (struct net_device_stats *)dev_get_stats(skb->dev, &temp);
	if (stats) {
		stats->rx_packets++;
		stats->rx_bytes += skb->len;
	}

	batman_packet = (struct batman_packet *)skb->data;

	if (batman_packet->version != COMPAT_VERSION) {
+8 −4
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ static int bat_socket_open(struct inode *inode, struct file *file)
	INIT_LIST_HEAD(&socket_client->queue_list);
	socket_client->queue_len = 0;
	socket_client->index = i;
	socket_client->bat_priv = inode->i_private;
	spin_lock_init(&socket_client->lock);
	init_waitqueue_head(&socket_client->queue_wait);

@@ -151,9 +152,8 @@ static ssize_t bat_socket_read(struct file *file, char __user *buf,
static ssize_t bat_socket_write(struct file *file, const char __user *buff,
				size_t len, loff_t *off)
{
	/* FIXME: each orig_node->batman_if will be attached to a softif */
	struct bat_priv *bat_priv = netdev_priv(soft_device);
	struct socket_client *socket_client = file->private_data;
	struct bat_priv *bat_priv = socket_client->bat_priv;
	struct icmp_packet_rr icmp_packet;
	struct orig_node *orig_node;
	struct batman_if *batman_if;
@@ -168,6 +168,9 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
		return -EINVAL;
	}

	if (!bat_priv->primary_if)
		return -EFAULT;

	if (len >= sizeof(struct icmp_packet_rr))
		packet_len = sizeof(struct icmp_packet_rr);

@@ -223,7 +226,8 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
	if (batman_if->if_status != IF_ACTIVE)
		goto dst_unreach;

	memcpy(icmp_packet.orig, batman_if->net_dev->dev_addr, ETH_ALEN);
	memcpy(icmp_packet.orig,
	       bat_priv->primary_if->net_dev->dev_addr, ETH_ALEN);

	if (packet_len == sizeof(struct icmp_packet_rr))
		memcpy(icmp_packet.rr, batman_if->net_dev->dev_addr, ETH_ALEN);
@@ -271,7 +275,7 @@ int bat_socket_setup(struct bat_priv *bat_priv)
		goto err;

	d = debugfs_create_file(ICMP_SOCKET, S_IFREG | S_IWUSR | S_IRUSR,
				bat_priv->debug_dir, NULL, &fops);
				bat_priv->debug_dir, bat_priv, &fops);
	if (d)
		goto err;

Loading