diff options
Diffstat (limited to 'fs/sysfs/file.c')
-rw-r--r-- | fs/sysfs/file.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index cba4c1c7383c..46618f81ae48 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c | |||
@@ -361,7 +361,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file) | |||
361 | error = -EACCES; | 361 | error = -EACCES; |
362 | module_put(attr->owner); | 362 | module_put(attr->owner); |
363 | Done: | 363 | Done: |
364 | if (error && kobj) | 364 | if (error) |
365 | kobject_put(kobj); | 365 | kobject_put(kobj); |
366 | return error; | 366 | return error; |
367 | } | 367 | } |
@@ -375,8 +375,7 @@ static int sysfs_release(struct inode * inode, struct file * filp) | |||
375 | 375 | ||
376 | if (buffer) | 376 | if (buffer) |
377 | remove_from_collection(buffer, inode); | 377 | remove_from_collection(buffer, inode); |
378 | if (kobj) | 378 | kobject_put(kobj); |
379 | kobject_put(kobj); | ||
380 | /* After this point, attr should not be accessed. */ | 379 | /* After this point, attr should not be accessed. */ |
381 | module_put(owner); | 380 | module_put(owner); |
382 | 381 | ||