diff -r ea389fb1ca84 -r 3e934e62ea62 erts/emulator/beam/erl_bif_ddll.c
--- a/erts/emulator/beam/erl_bif_ddll.c
+++ b/erts/emulator/beam/erl_bif_ddll.c
@@ -2117,6 +2117,8 @@ static int build_ffi_preloads(Eterm lst,
     ffi_type **ftypes;
     void *fptr;
 
+    assert_drv_list_locked();
+ 
     /* We want one single allocation for all the preload data, so we
      * need to count how many preloads and ffi_type's we are going to
      * handle */
@@ -2176,7 +2178,7 @@ static int build_ffi_preloads(Eterm lst,
 	if ((funcname = pick_list_or_atom(tpval[1])) == NULL)
 	    goto error;
 
-	if ((fptr = driver_dl_sym(dh->handle, funcname)) == NULL)
+	if (erts_sys_ddll_sym(dh->handle, funcname, &fptr) != ERL_DE_NO_ERROR)
 	    goto error;
 	
 	preloads[i].name = strcpy(fnames, funcname);
@@ -2228,11 +2230,16 @@ static void refresh_ffi_preloads(DE_Hand
     Uint npreloads = dh->npreloads;
     Uint i;
 
+    assert_drv_list_locked();
+
     if (dh->preloads == NULL)
 	return;
 
     for (i = 0; i < npreloads; ++i) {
-	preloads[i].function = driver_dl_sym(dh->handle, preloads[i].name);
+	if (erts_sys_ddll_sym(dh->handle, preloads[i].name,
+			      &preloads[i].function) != ERL_DE_NO_ERROR) {
+	    preloads[i].function = NULL;
+	}
     }
 }
 
@@ -2248,6 +2255,8 @@ static Eterm build_preloads_info(Process
     Uint nargs;
     Uint npreloads = (dh == NULL? 0 : dh->npreloads); /* Static driver? */
     int len, fname_lengths[npreloads];
+
+    assert_drv_list_locked();
 
     if (npreloads == 0) {
 	return NIL; /* The list of preloads is empty */
diff -r ea389fb1ca84 -r 3e934e62ea62 erts/emulator/beam/erl_bif_ffi.c
--- a/erts/emulator/beam/erl_bif_ffi.c
+++ b/erts/emulator/beam/erl_bif_ffi.c
@@ -168,7 +168,7 @@ Eterm erts_make_signed_integer(Sint x, P
  */
 BIF_RETTYPE ffi_raw_call_3(BIF_ALIST_3)
 {
-    Port* p;
+    Port* prt;
     void* handle;
     void* fptr;
     Eterm *calltp, *typestp;
@@ -177,11 +177,13 @@ BIF_RETTYPE ffi_raw_call_3(BIF_ALIST_3)
     Eterm res;
     int status = 0; /* Will possibly contain internal error codes */
 
-    p = id_or_name2port(BIF_P, BIF_ARG_1);
-    if (!p) {
+    prt = id_or_name2port(BIF_P, BIF_ARG_1);
+    if (!prt) {
     error:
         if (fname != NULL)
             erts_free(ERTS_ALC_T_DDLL_TMP_BUF, (void *) fname);
+	if (prt)
+	    erts_smp_port_unlock(prt);
         BIF_ERROR(BIF_P, BADARG);
     }
 
@@ -202,10 +204,10 @@ BIF_RETTYPE ffi_raw_call_3(BIF_ALIST_3)
     ++calltp;
 
     /* FIXME: is the following check really necessary? */
-    if (!p->drv_ptr)
+    if (!prt->drv_ptr)
         goto error; /* The port is not associated to a driver */    
     /* FIXME: is it possible that drv_ptr->handle is NULL? */
-    handle = ((DE_Handle*) p->drv_ptr->handle)->handle;
+    handle = ((DE_Handle*) prt->drv_ptr->handle)->handle;
 
     /* Extract function name from the first tuple element... */
     if ((fname = pick_list_or_atom(calltp[0])) == NULL)
@@ -256,10 +258,12 @@ BIF_RETTYPE ffi_raw_call_3(BIF_ALIST_3)
 	}
     }
 
+    erts_smp_port_unlock(prt);
     BIF_RET(res);
 
     late_error:
     erts_free(ERTS_ALC_T_DDLL_TMP_BUF, (void *) fname);
+    erts_smp_port_unlock(prt);
     switch (status) {
     case ERL_FFI_STATUS_BADARG:
 	BIF_ERROR(BIF_P, BADARG);
@@ -286,7 +290,7 @@ BIF_RETTYPE ffi_raw_call_3(BIF_ALIST_3)
  */
 BIF_RETTYPE ffi_raw_call_2(BIF_ALIST_2)
 {
-    Port* p;
+    Port* prt;
     DE_Handle* de_handle;
     Uint npreloads;
     FFIPreload* preload;
@@ -295,9 +299,11 @@ BIF_RETTYPE ffi_raw_call_2(BIF_ALIST_2)
     Eterm res;
     int status = 0; /* Will possibly contain internal error codes */
 
-    p = id_or_name2port(BIF_P, BIF_ARG_1);
-    if (!p) {
+    prt = id_or_name2port(BIF_P, BIF_ARG_1);
+    if (!prt) {
     error:
+	if (prt)
+	    erts_smp_port_unlock(prt);
         BIF_ERROR(BIF_P, BADARG);
     }
 
@@ -315,9 +321,9 @@ BIF_RETTYPE ffi_raw_call_2(BIF_ALIST_2)
     ++calltp;
     
     /* FIXME: is the following check really necessary? */
-    if (!p->drv_ptr)
+    if (!prt->drv_ptr)
         goto error; /* The port is not associated to a driver */    
-    de_handle = (DE_Handle*) p->drv_ptr->handle;
+    de_handle = (DE_Handle*) prt->drv_ptr->handle;
     npreloads = de_handle->npreloads;
 
     /* Is the given function index within bounds? */
@@ -369,9 +375,11 @@ BIF_RETTYPE ffi_raw_call_2(BIF_ALIST_2)
 	}
     }
 
+    erts_smp_port_unlock(prt);
     BIF_RET(res);
 
     late_error:
+    erts_smp_port_unlock(prt);
     if (status) {
         switch (status) {
         case ERL_FFI_STATUS_BADARG:
