Skip to content

Commit 484796e

Browse files
authored
エラーハンドリング時のリソースリークが起こり得る箇所の修正 (#96)
1 parent 831fe3c commit 484796e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/drivers/rtmouse_dev.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ static int i2c_counter_set(struct rtcnt_device_info *dev_info, int setval)
5959
printk(KERN_ERR
6060
"%s: Failed writing to i2c counter device, addr=0x%x\n",
6161
__func__, client->addr);
62+
mutex_unlock(&dev_info->lock);
6263
return -ENODEV;
6364
}
6465
// printk(KERN_INFO "set 0x%x lsb = 0x%x\n", client->addr, lsb);
@@ -67,6 +68,7 @@ static int i2c_counter_set(struct rtcnt_device_info *dev_info, int setval)
6768
printk(KERN_ERR
6869
"%s: Failed writing to i2c counter device, addr=0x%x\n",
6970
__func__, client->addr);
71+
mutex_unlock(&dev_info->lock);
7072
return -ENODEV;
7173
}
7274
mutex_unlock(&dev_info->lock);
@@ -90,6 +92,7 @@ static int i2c_counter_read(struct rtcnt_device_info *dev_info, int *ret)
9092
KERN_ERR
9193
"%s: Failed reading from i2c counter device, addr=0x%x\n",
9294
__func__, client->addr);
95+
mutex_unlock(&dev_info->lock);
9396
return -ENODEV;
9497
}
9598
msb = i2c_smbus_read_byte_data(client, CNT_ADDR_MSB);
@@ -98,6 +101,7 @@ static int i2c_counter_read(struct rtcnt_device_info *dev_info, int *ret)
98101
KERN_ERR
99102
"%s: Failed reading from i2c counter device, addr=0x%x\n",
100103
__func__, client->addr);
104+
mutex_unlock(&dev_info->lock);
101105
return -ENODEV;
102106
}
103107
mutex_unlock(&dev_info->lock);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy