Showing error 930

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: drivers/rtc/rtc-ds1374.c
Line in file: 286
Project: Linux Kernel
Project version: 2.6.28
Confirmation: Fixed by 28df30e61b46a33d1f0bb60757747396886ef687
Tools: Stanse (1.2)
Entered: 2012-03-02 21:35:17 UTC


Source:

256                cr &= ~DS1374_REG_CR_WDALM;
257
258                ret = i2c_smbus_write_byte_data(client, DS1374_REG_CR, cr);
259        }
260
261out:
262        mutex_unlock(&ds1374->mutex);
263        return ret;
264}
265
266static irqreturn_t ds1374_irq(int irq, void *dev_id)
267{
268        struct i2c_client *client = dev_id;
269        struct ds1374 *ds1374 = i2c_get_clientdata(client);
270
271        disable_irq_nosync(irq);
272        schedule_work(&ds1374->work);
273        return IRQ_HANDLED;
274}
275
276static void ds1374_work(struct work_struct *work)
277{
278        struct ds1374 *ds1374 = container_of(work, struct ds1374, work);
279        struct i2c_client *client = ds1374->client;
280        int stat, control;
281
282        mutex_lock(&ds1374->mutex);
283
284        stat = i2c_smbus_read_byte_data(client, DS1374_REG_SR);
285        if (stat < 0)
286                return;
287
288        if (stat & DS1374_REG_SR_AF) {
289                stat &= ~DS1374_REG_SR_AF;
290                i2c_smbus_write_byte_data(client, DS1374_REG_SR, stat);
291
292                control = i2c_smbus_read_byte_data(client, DS1374_REG_CR);
293                if (control < 0)
294                        goto out;
295
296                control &= ~(DS1374_REG_CR_WACE | DS1374_REG_CR_AIE);
Show full sources