Skip to content

Commit

Permalink
エラーハンドリング"mutex_unlock"の呼び出しを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
KuraZuzu committed Dec 9, 2024
1 parent 831fe3c commit ed5b578
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit ed5b578

Please sign in to comment.