Skip to content

Commit 49bd04a

Browse files
authored
Updated pcd_lock.c
1 parent e5de6ce commit 49bd04a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

custom_drivers/002pseudo_char_driver/pcd_lock.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,9 @@ ssize_t pcd_write(struct file *filp, const char __user *buff, size_t count, loff
123123

124124
/*copy from user */
125125
if(copy_from_user(&device_buffer[*f_pos],buff,count)){
126-
mutex_unlock(&pcd_mutex_lock);
126+
mutex_unlock(&pcd_mutex_lock);
127127
return -EFAULT;
128128
}
129-
130-
else {
131-
132129
/*update the current file postion */
133130
*f_pos += count;
134131

@@ -141,7 +138,6 @@ ssize_t pcd_write(struct file *filp, const char __user *buff, size_t count, loff
141138
/*Return number of bytes which have been successfully written */
142139
return count;
143140
}
144-
}
145141

146142
int pcd_open(struct inode *inode, struct file *filp)
147143
{

0 commit comments

Comments
 (0)