Re: [PATCH] staging: pi433: add rw semaphore fixing concurrency issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 01 Jun 2018 08:50:37 -0400, Hugo Lefeuvre said:

> @@ -805,9 +809,11 @@ pi433_read(struct file *filp, char __user *buf, size_t size, loff_t *f_pos)
>  	if (bytes_received > 0) {
>  		retval = copy_to_user(buf, device->rx_buffer, bytes_received);
>  		if (retval)
> +			up_read(&instance->instance_sem);
>  			return -EFAULT;
>  	}
>
> +	up_read(&instance->instance_sem);
>  	return bytes_received;
>  }

This doesn't do what you think.

Attachment: pgp7d_GZXqI2v.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux