From: valdis.kletnieks@vt.edu (valdis.kletnieks at vt.edu) Date: Fri, 01 Jun 2018 09:32:22 -0400 Subject: [PATCH] staging: pi433: add rw semaphore fixing concurrency issues In-Reply-To: <20180601125037.GA2339@hle-laptop.local> References: <20180601125037.GA2339@hle-laptop.local> Message-ID: <255415.1527859942@turing-police.cc.vt.edu> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 486 bytes Desc: not available URL: