340.107 driver compiles, but can't be loaded on 5.1.2 kernel

I have Slackware 14.2 with 5.1.2 kernel. Trying to install 340.107 Nvidia driver. After couple of patches, it has compiled successfully, but installer gives me error trying to load kernel module.
nvidia-install.log is in attached file. I hit same errors copying the built kernel module to kernel modules directory and trying to load it via modprobe nvidia. Nouveau is blacklisted and not loaded during install. All operations performed at runlevel 3 as root.
Applied patches (module doesn’t compile without it):

Tried the larger Ubuntu patch?
https://launchpadlibrarian.net/434576444/nvidia-graphics-drivers-340_340.107-0ubuntu0.18.04.3.diff.gz

Yes, applying that patch finally got things work. Thanks a lot!