]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ptp: ptp_read should not release queue
authorEdward Adam Davis <eadavis@qq.com>
Tue, 7 Nov 2023 08:00:40 +0000 (16:00 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 9 Nov 2023 02:47:07 +0000 (18:47 -0800)
Firstly, queue is not the memory allocated in ptp_read;
Secondly, other processes may block at ptp_read and wait for conditions to be
met to perform read operations.

Acked-by: Richard Cochran <richardcochran@gmail.com>
Reported-and-tested-by: syzbot+df3f3ef31f60781fa911@syzkaller.appspotmail.com
Fixes: 8f5de6fb2453 ("ptp: support multiple timestamp event readers")
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
Link: https://lore.kernel.org/r/tencent_18747D76F1675A3C633772960237544AAA09@qq.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/ptp/ptp_chardev.c

index 282cd7d24077389780268d6ed8ee96a69041d84b..27c1ef4936174491daa716e39c5ede2de13d8c35 100644 (file)
@@ -585,7 +585,5 @@ ssize_t ptp_read(struct posix_clock_context *pccontext, uint rdflags,
 free_event:
        kfree(event);
 exit:
-       if (result < 0)
-               ptp_release(pccontext);
        return result;
 }