diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2014-06-13 17:29:11 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2014-06-16 10:32:38 +0200 |
commit | 0310c8b582d70e2d5070600f7b2c93a22dc4e7e0 (patch) | |
tree | d9830cd911067711a619e49575e6b0c5ae63687c /drivers | |
parent | 9280ddb19489fa24e2d4f6f492d185ae1172bec2 (diff) | |
download | linux-0310c8b582d70e2d5070600f7b2c93a22dc4e7e0.tar.bz2 |
s390/ccwgroup: fix an uninitialized return code
Since commit 0b60f9ead5d4816e7e3d6e28f4a0d22d4a1b2513
"s390: use device_remove_file_self() instead of device_schedule_callback()"
the return code of ccwgroup_ungroup_store is uninitialized. Make
sure the rc is always initialized.
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/cio/ccwgroup.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index 040e643746aa..4ec19870447e 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c @@ -184,7 +184,7 @@ static ssize_t ccwgroup_ungroup_store(struct device *dev, const char *buf, size_t count) { struct ccwgroup_device *gdev = to_ccwgroupdev(dev); - int rc; + int rc = 0; /* Prevent concurrent online/offline processing and ungrouping. */ if (atomic_cmpxchg(&gdev->onoff, 0, 1) != 0) @@ -196,11 +196,12 @@ static ssize_t ccwgroup_ungroup_store(struct device *dev, if (device_remove_file_self(dev, attr)) ccwgroup_ungroup(gdev); + else + rc = -ENODEV; out: if (rc) { - if (rc != -EAGAIN) - /* Release onoff "lock" when ungrouping failed. */ - atomic_set(&gdev->onoff, 0); + /* Release onoff "lock" when ungrouping failed. */ + atomic_set(&gdev->onoff, 0); return rc; } return count; |