update_user_meta() not working

wp_get_current_user() returns an object. update_user_meta( $user_id, $meta_key, $meta_value, $prev_value ) accepts user_id as first parameter. Use the following code to get user ID from wp_get_current_user()

update_user_meta( $user->ID, 'custom_user_fields', $userData );