A pointer is first tested for NULL. If non-NULL, another pointer is set equal to the first. The second pointer is then checked for NULL and an error path taken if so. This second test and the associated path is dead code as the pointer value, having just been checked for NULL, cannot be NULL at this point. Remove the dead code.
Looks good to me. I would not be shocked if there are plenty of similar cases elsewhere in the driver.
We should also strongly consider addressing the additional change added at $WORK while we're in this function. I can send you the details, but there was a fairly bad issue in this ioctl path where if ESGL bit in the request isn't initialized the card may end up basically doing a DMA to host memory unexpectedly. Whether we combine that or do a separate review is fine, but that's one of the more... concerning, and discrete fixes (and easily testable by calling the ioctl) that we have that could use upstreaming.