* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: fix setattr error handling in sysfs, configfs kobject: free memory if netlink_kernel_create() fails lib/kobject_uevent.c: fix CONIG_NET=n warning
Unified · Split
| @@ -72,10 +72,6 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr) · 71 unmodified lines | ||
| 72 | 72 | if (!sd) |
| 73 | 73 | return -EINVAL; |
| 74 | 74 | |
| 75 | − error = simple_setattr(dentry, iattr); | |
| 76 | − if (error) | |
| 77 | − return error; | |
| 78 | − | |
| 79 | 75 | sd_iattr = sd->s_iattr; |
| 80 | 76 | if (!sd_iattr) { |
| 81 | 77 | /* setting attributes for the first time, allocate now */ |
| @@ -89,9 +85,12 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr) · 7 unmodified lines | ||
| 89 | 85 | sd_iattr->ia_atime = sd_iattr->ia_mtime = sd_iattr->ia_ctime = CURRENT_TIME; |
| 90 | 86 | sd->s_iattr = sd_iattr; |
| 91 | 87 | } |
| 92 | − | |
| 93 | 88 | /* attributes were changed atleast once in past */ |
| 94 | 89 | |
| 90 | + error = simple_setattr(dentry, iattr); | |
| 91 | + if (error) | |
| 92 | + return error; | |
| 93 | + | |
| 95 | 94 | if (ia_valid & ATTR_UID) |
| 96 | 95 | sd_iattr->ia_uid = iattr->ia_uid; |
| 97 | 96 | if (ia_valid & ATTR_GID) |
| @@ -117,11 +117,13 @@ int sysfs_setattr(struct dentry *dentry, struct iattr *iattr) · 116 unmodified lines | ||
| 117 | 117 | if (error) |
| 118 | 118 | goto out; |
| 119 | 119 | |
| 120 | + error = sysfs_sd_setattr(sd, iattr); | |
| 121 | + if (error) | |
| 122 | + goto out; | |
| 123 | + | |
| 120 | 124 | /* this ignores size changes */ |
| 121 | 125 | generic_setattr(inode, iattr); |
| 122 | 126 | |
| 123 | − error = sysfs_sd_setattr(sd, iattr); | |
| 124 | − | |
| 125 | 127 | out: |
| 126 | 128 | mutex_unlock(&sysfs_mutex); |
| 127 | 129 | return error; |
| @@ -83,6 +83,7 @@ out: · 82 unmodified lines | ||
| 83 | 83 | return ret; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | +#ifdef CONFIG_NET | |
| 86 | 87 | static int kobj_bcast_filter(struct sock *dsk, struct sk_buff *skb, void *data) |
| 87 | 88 | { |
| 88 | 89 | struct kobject *kobj = data; |
| @@ -98,6 +99,7 @@ static int kobj_bcast_filter(struct sock *dsk, struct sk_buff *skb, void *data) · 9 unmodified lines | ||
| 98 | 99 | |
| 99 | 100 | return 0; |
| 100 | 101 | } |
| 102 | +#endif | |
| 101 | 103 | |
| 102 | 104 | static int kobj_usermode_filter(struct kobject *kobj) |
| 103 | 105 | { |
| @@ -378,6 +380,7 @@ static int uevent_net_init(struct net *net) · 274 unmodified lines | ||
| 378 | 380 | if (!ue_sk->sk) { |
| 379 | 381 | printk(KERN_ERR |
| 380 | 382 | "kobject_uevent: unable to create netlink socket!\n"); |
| 383 | + kfree(ue_sk); | |
| 381 | 384 | return -ENODEV; |
| 382 | 385 | } |
| 383 | 386 | mutex_lock(&uevent_sock_mutex); |