ret = device_register(&tx_chn->common.chan_dev);
        if (ret) {
                dev_err(dev, "Channel Device registration failed %d\n", ret);
+               put_device(&tx_chn->common.chan_dev);
                tx_chn->common.chan_dev.parent = NULL;
                goto err;
        }
        ret = device_register(&rx_chn->common.chan_dev);
        if (ret) {
                dev_err(dev, "Channel Device registration failed %d\n", ret);
+               put_device(&rx_chn->common.chan_dev);
                rx_chn->common.chan_dev.parent = NULL;
                goto err;
        }
        ret = device_register(&rx_chn->common.chan_dev);
        if (ret) {
                dev_err(dev, "Channel Device registration failed %d\n", ret);
+               put_device(&rx_chn->common.chan_dev);
                rx_chn->common.chan_dev.parent = NULL;
                goto err;
        }