Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

エラーハンドリング時のリソースリークが起こり得る箇所の修正 #96

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/drivers/rtmouse_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ static int i2c_counter_set(struct rtcnt_device_info *dev_info, int setval)
printk(KERN_ERR
"%s: Failed writing to i2c counter device, addr=0x%x\n",
__func__, client->addr);
mutex_unlock(&dev_info->lock);
return -ENODEV;
}
// printk(KERN_INFO "set 0x%x lsb = 0x%x\n", client->addr, lsb);
Expand All @@ -67,6 +68,7 @@ static int i2c_counter_set(struct rtcnt_device_info *dev_info, int setval)
printk(KERN_ERR
"%s: Failed writing to i2c counter device, addr=0x%x\n",
__func__, client->addr);
mutex_unlock(&dev_info->lock);
return -ENODEV;
}
mutex_unlock(&dev_info->lock);
Expand All @@ -90,6 +92,7 @@ static int i2c_counter_read(struct rtcnt_device_info *dev_info, int *ret)
KERN_ERR
"%s: Failed reading from i2c counter device, addr=0x%x\n",
__func__, client->addr);
mutex_unlock(&dev_info->lock);
return -ENODEV;
}
msb = i2c_smbus_read_byte_data(client, CNT_ADDR_MSB);
Expand All @@ -98,6 +101,7 @@ static int i2c_counter_read(struct rtcnt_device_info *dev_info, int *ret)
KERN_ERR
"%s: Failed reading from i2c counter device, addr=0x%x\n",
__func__, client->addr);
mutex_unlock(&dev_info->lock);
return -ENODEV;
}
mutex_unlock(&dev_info->lock);
Expand Down
Loading