Revert "ptp: Fixes a null pointer dereference in ptp_ioctl"
authorJakub Kicinski <kuba@kernel.org>
Tue, 14 Nov 2023 04:49:39 +0000 (20:49 -0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 14 Nov 2023 04:50:12 +0000 (20:50 -0800)
This reverts commit 8a4f030dbced6fc255cbe67b2d0a129947e18493.

Richard says:

  The test itself is harmless, but keeping it will make people think,
  "oh this pointer can be invalid."

  In fact the core stack ensures that ioctl() can't be invoked after
  release(), otherwise Bad Stuff happens.

Fixes: 8a4f030dbced ("ptp: Fixes a null pointer dereference in ptp_ioctl")
Link: https://lore.kernel.org/all/ZVAf_qdRfDAQYUt-@hoboy.vegasvil.org/
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/ptp/ptp_chardev.c

index e95a6ed130ef4490c73e0da24c4da3256628cc71..3f7a7478880240a2d256caf624b61dcc8e7054af 100644 (file)
@@ -176,8 +176,6 @@ long ptp_ioctl(struct posix_clock_context *pccontext, unsigned int cmd,
        int enable, err = 0;
 
        tsevq = pccontext->private_clkdata;
-       if (!tsevq)
-               return -EINVAL;
 
        switch (cmd) {