History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6

* 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

Linus Torvalds committed 16 years ago

Commit f9196e72 parents bf4282c 75de46b3 files · +11 −7Browse files

Unified · Split

3 files
  1. fs/configfs/inode.c +4 −5
  2. fs/sysfs/inode.c +4 −2
  3. lib/kobject_uevent.c +3 −0
fs/configfs/inode.c+4−5
@@ -72,10 +72,6 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr) · 71 unmodified lines
7272 if (!sd)
7373 return -EINVAL;
7474
75− error = simple_setattr(dentry, iattr);
76− if (error)
77− return error;
78−
7975 sd_iattr = sd->s_iattr;
8076 if (!sd_iattr) {
8177 /* setting attributes for the first time, allocate now */
@@ -89,9 +85,12 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr) · 7 unmodified lines
8985 sd_iattr->ia_atime = sd_iattr->ia_mtime = sd_iattr->ia_ctime = CURRENT_TIME;
9086 sd->s_iattr = sd_iattr;
9187 }
92−
9388 /* attributes were changed atleast once in past */
9489
90+ error = simple_setattr(dentry, iattr);
91+ if (error)
92+ return error;
93+
9594 if (ia_valid & ATTR_UID)
9695 sd_iattr->ia_uid = iattr->ia_uid;
9796 if (ia_valid & ATTR_GID)
fs/sysfs/inode.c+4−2
@@ -117,11 +117,13 @@ int sysfs_setattr(struct dentry *dentry, struct iattr *iattr) · 116 unmodified lines
117117 if (error)
118118 goto out;
119119
120+ error = sysfs_sd_setattr(sd, iattr);
121+ if (error)
122+ goto out;
123+
120124 /* this ignores size changes */
121125 generic_setattr(inode, iattr);
122126
123− error = sysfs_sd_setattr(sd, iattr);
124−
125127 out:
126128 mutex_unlock(&sysfs_mutex);
127129 return error;
lib/kobject_uevent.c+3−0
@@ -83,6 +83,7 @@ out: · 82 unmodified lines
8383 return ret;
8484 }
8585
86+#ifdef CONFIG_NET
8687 static int kobj_bcast_filter(struct sock *dsk, struct sk_buff *skb, void *data)
8788 {
8889 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
9899
99100 return 0;
100101 }
102+#endif
101103
102104 static int kobj_usermode_filter(struct kobject *kobj)
103105 {
@@ -378,6 +380,7 @@ static int uevent_net_init(struct net *net) · 274 unmodified lines
378380 if (!ue_sk->sk) {
379381 printk(KERN_ERR
380382 "kobject_uevent: unable to create netlink socket!\n");
383+ kfree(ue_sk);
381384 return -ENODEV;
382385 }
383386 mutex_lock(&uevent_sock_mutex);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t