return ret;
 
        ret = v4l2_async_nf_call_bound(notifier, sd, asc);
-       if (ret < 0) {
-               v4l2_device_unregister_subdev(sd);
-               return ret;
-       }
+       if (ret < 0)
+               goto err_unregister_subdev;
 
        /*
         * Depending of the function of the entities involved, we may want to
         * pad).
         */
        ret = v4l2_async_create_ancillary_links(notifier, sd);
-       if (ret) {
-               v4l2_async_nf_call_unbind(notifier, sd, asc);
-               v4l2_device_unregister_subdev(sd);
-               return ret;
-       }
+       if (ret)
+               goto err_call_unbind;
 
        list_del(&asc->waiting_entry);
        sd->asd = asc;
        subdev_notifier->parent = notifier;
 
        return v4l2_async_nf_try_all_subdevs(subdev_notifier);
+
+err_call_unbind:
+       v4l2_async_nf_call_unbind(notifier, sd, asc);
+
+err_unregister_subdev:
+       v4l2_device_unregister_subdev(sd);
+
+       return ret;
 }
 
 /* Test all async sub-devices in a notifier for a match. */