--- zzzz-none-000/linux-3.10.107/drivers/char/xilinx_hwicap/xilinx_hwicap.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/char/xilinx_hwicap/xilinx_hwicap.c 2021-02-04 17:41:59.000000000 +0000 @@ -661,6 +661,7 @@ drvdata->base_address = ioremap(drvdata->mem_start, drvdata->mem_size); if (!drvdata->base_address) { dev_err(dev, "ioremap() failed\n"); + retval = -ENOMEM; goto failed2; } @@ -721,7 +722,7 @@ { struct hwicap_drvdata *drvdata; - drvdata = (struct hwicap_drvdata *)dev_get_drvdata(dev); + drvdata = dev_get_drvdata(dev); if (!drvdata) return 0; @@ -731,7 +732,6 @@ iounmap(drvdata->base_address); release_mem_region(drvdata->mem_start, drvdata->mem_size); kfree(drvdata); - dev_set_drvdata(dev, NULL); mutex_lock(&icap_sem); probed_devices[MINOR(dev->devt)-XHWICAP_MINOR] = 0; @@ -843,7 +843,6 @@ .probe = hwicap_drv_probe, .remove = hwicap_drv_remove, .driver = { - .owner = THIS_MODULE, .name = DRIVER_NAME, .of_match_table = hwicap_of_match, },