aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2014-06-13 11:29:11 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2014-06-16 04:32:38 -0400
commit0310c8b582d70e2d5070600f7b2c93a22dc4e7e0 (patch)
treed9830cd911067711a619e49575e6b0c5ae63687c /drivers/s390
parent9280ddb19489fa24e2d4f6f492d185ae1172bec2 (diff)
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/s390')
-rw-r--r--drivers/s390/cio/ccwgroup.c9
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,
184 const char *buf, size_t count) 184 const char *buf, size_t count)
185{ 185{
186 struct ccwgroup_device *gdev = to_ccwgroupdev(dev); 186 struct ccwgroup_device *gdev = to_ccwgroupdev(dev);
187 int rc; 187 int rc = 0;
188 188
189 /* Prevent concurrent online/offline processing and ungrouping. */ 189 /* Prevent concurrent online/offline processing and ungrouping. */
190 if (atomic_cmpxchg(&gdev->onoff, 0, 1) != 0) 190 if (atomic_cmpxchg(&gdev->onoff, 0, 1) != 0)
@@ -196,11 +196,12 @@ static ssize_t ccwgroup_ungroup_store(struct device *dev,
196 196
197 if (device_remove_file_self(dev, attr)) 197 if (device_remove_file_self(dev, attr))
198 ccwgroup_ungroup(gdev); 198 ccwgroup_ungroup(gdev);
199 else
200 rc = -ENODEV;
199out: 201out:
200 if (rc) { 202 if (rc) {
201 if (rc != -EAGAIN) 203 /* Release onoff "lock" when ungrouping failed. */
202 /* Release onoff "lock" when ungrouping failed. */ 204 atomic_set(&gdev->onoff, 0);
203 atomic_set(&gdev->onoff, 0);
204 return rc; 205 return rc;
205 } 206 }
206 return count; 207 return count;