copy back from gpu

hi guys
I have a question,
I have used (cudaMallocPitch((void**)&g_disparityLeft,&g_floatDispPitch,w*sizeof(float),h)
to create an array in cuda, after some calculation, I want to copy it back to host
what i have done is

h_disparityFloat = (float )malloc(g_wg_hsizeof(float));
cudaMemcpy2D(h_disparityFloat,g_w
sizeof(float),g_disparityL
eft,g_floatDispPitch
,g_w*sizeof(float),g_h,cudaMemcpyDeviceToHost);

but the value is wrong
where am i going wrong,

thank you