aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-18 13:18:39 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-18 13:18:39 -0400
commit5cc97bf2d8eaa6cab60727c3eba3e85e29062669 (patch)
tree975976f2cb37b932d65440e6fb9960be93fc0bd7 /net
parent826ea8f22cf612d534f33c492c98f7895043bfd1 (diff)
parentdfdcdd42fdf63452ddd1bed6f49ae2a35dfb5d6c (diff)
Merge branch 'xen-upstream' of ssh://master.kernel.org/pub/scm/linux/kernel/git/jeremy/xen
* 'xen-upstream' of ssh://master.kernel.org/pub/scm/linux/kernel/git/jeremy/xen: (44 commits) xen: disable all non-virtual drivers xen: use iret directly when possible xen: suppress abs symbol warnings for unused reloc pointers xen: Attempt to patch inline versions of common operations xen: Place vcpu_info structure into per-cpu memory xen: handle external requests for shutdown, reboot and sysrq xen: machine operations xen: add virtual network device driver xen: add virtual block device driver. xen: add the Xenbus sysfs and virtual device hotplug driver xen: Add grant table support xen: use the hvc console infrastructure for Xen console xen: hack to prevent bad segment register reload xen: lazy-mmu operations xen: Add support for preemption xen: SMP guest support xen: Implement sched_clock xen: Account for stolen time xen: ignore RW mapping of RO pages in pagetable_init xen: Complete pagetable pinning ...
Diffstat (limited to 'net')
-rw-r--r--net/bridge/br_stp_if.c2
-rw-r--r--net/irda/irias_object.c43
2 files changed, 6 insertions, 39 deletions
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index a786e78632..1ea2f86f76 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -125,7 +125,7 @@ static void br_stp_start(struct net_bridge *br)
125 char *argv[] = { BR_STP_PROG, br->dev->name, "start", NULL }; 125 char *argv[] = { BR_STP_PROG, br->dev->name, "start", NULL };
126 char *envp[] = { NULL }; 126 char *envp[] = { NULL };
127 127
128 r = call_usermodehelper(BR_STP_PROG, argv, envp, 1); 128 r = call_usermodehelper(BR_STP_PROG, argv, envp, UMH_WAIT_PROC);
129 if (r == 0) { 129 if (r == 0) {
130 br->stp_enabled = BR_USER_STP; 130 br->stp_enabled = BR_USER_STP;
131 printk(KERN_INFO "%s: userspace STP started\n", br->dev->name); 131 printk(KERN_INFO "%s: userspace STP started\n", br->dev->name);
diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c
index 4adaae242b..cf30245709 100644
--- a/net/irda/irias_object.c
+++ b/net/irda/irias_object.c
@@ -36,39 +36,6 @@ hashbin_t *irias_objects;
36 */ 36 */
37struct ias_value irias_missing = { IAS_MISSING, 0, 0, 0, {0}}; 37struct ias_value irias_missing = { IAS_MISSING, 0, 0, 0, {0}};
38 38
39/*
40 * Function strndup (str, max)
41 *
42 * My own kernel version of strndup!
43 *
44 * Faster, check boundary... Jean II
45 */
46static char *strndup(char *str, size_t max)
47{
48 char *new_str;
49 int len;
50
51 /* Check string */
52 if (str == NULL)
53 return NULL;
54 /* Check length, truncate */
55 len = strlen(str);
56 if(len > max)
57 len = max;
58
59 /* Allocate new string */
60 new_str = kmalloc(len + 1, GFP_ATOMIC);
61 if (new_str == NULL) {
62 IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
63 return NULL;
64 }
65
66 /* Copy and truncate */
67 memcpy(new_str, str, len);
68 new_str[len] = '\0';
69
70 return new_str;
71}
72 39
73/* 40/*
74 * Function ias_new_object (name, id) 41 * Function ias_new_object (name, id)
@@ -90,7 +57,7 @@ struct ias_object *irias_new_object( char *name, int id)
90 } 57 }
91 58
92 obj->magic = IAS_OBJECT_MAGIC; 59 obj->magic = IAS_OBJECT_MAGIC;
93 obj->name = strndup(name, IAS_MAX_CLASSNAME); 60 obj->name = kstrndup(name, IAS_MAX_CLASSNAME, GFP_ATOMIC);
94 if (!obj->name) { 61 if (!obj->name) {
95 IRDA_WARNING("%s(), Unable to allocate name!\n", 62 IRDA_WARNING("%s(), Unable to allocate name!\n",
96 __FUNCTION__); 63 __FUNCTION__);
@@ -360,7 +327,7 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value,
360 } 327 }
361 328
362 attrib->magic = IAS_ATTRIB_MAGIC; 329 attrib->magic = IAS_ATTRIB_MAGIC;
363 attrib->name = strndup(name, IAS_MAX_ATTRIBNAME); 330 attrib->name = kstrndup(name, IAS_MAX_ATTRIBNAME, GFP_ATOMIC);
364 331
365 /* Insert value */ 332 /* Insert value */
366 attrib->value = irias_new_integer_value(value); 333 attrib->value = irias_new_integer_value(value);
@@ -404,7 +371,7 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets,
404 } 371 }
405 372
406 attrib->magic = IAS_ATTRIB_MAGIC; 373 attrib->magic = IAS_ATTRIB_MAGIC;
407 attrib->name = strndup(name, IAS_MAX_ATTRIBNAME); 374 attrib->name = kstrndup(name, IAS_MAX_ATTRIBNAME, GFP_ATOMIC);
408 375
409 attrib->value = irias_new_octseq_value( octets, len); 376 attrib->value = irias_new_octseq_value( octets, len);
410 if (!attrib->name || !attrib->value) { 377 if (!attrib->name || !attrib->value) {
@@ -446,7 +413,7 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value,
446 } 413 }
447 414
448 attrib->magic = IAS_ATTRIB_MAGIC; 415 attrib->magic = IAS_ATTRIB_MAGIC;
449 attrib->name = strndup(name, IAS_MAX_ATTRIBNAME); 416 attrib->name = kstrndup(name, IAS_MAX_ATTRIBNAME, GFP_ATOMIC);
450 417
451 attrib->value = irias_new_string_value(value); 418 attrib->value = irias_new_string_value(value);
452 if (!attrib->name || !attrib->value) { 419 if (!attrib->name || !attrib->value) {
@@ -506,7 +473,7 @@ struct ias_value *irias_new_string_value(char *string)
506 473
507 value->type = IAS_STRING; 474 value->type = IAS_STRING;
508 value->charset = CS_ASCII; 475 value->charset = CS_ASCII;
509 value->t.string = strndup(string, IAS_MAX_STRING); 476 value->t.string = kstrndup(string, IAS_MAX_STRING, GFP_ATOMIC);
510 if (!value->t.string) { 477 if (!value->t.string) {
511 IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); 478 IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
512 kfree(value); 479 kfree(value);