#define deref_helper(ptr) (*(typeof(size_t *))ptr)
#define size_helper(x) sizeof(x)
+static inline struct flat_binder_object *copy_flat_binder_object(void __user *ptr)
+{
+ return (struct flat_binder_object *)ptr;
+}
+
enum binder_stat_types {
BINDER_STAT_PROC,
BINDER_STAT_THREAD,
debug_id, deref_helper(offp), buffer->data_size);
continue;
}
- fp = (struct flat_binder_object *)(buffer->data + deref_helper(offp));
+ fp = copy_flat_binder_object(buffer->data + deref_helper(offp));
switch (fp->type) {
case BINDER_TYPE_BINDER:
case BINDER_TYPE_WEAK_BINDER: {
return_error = BR_FAILED_REPLY;
goto err_bad_offset;
}
- fp = (struct flat_binder_object *)(t->buffer->data + deref_helper(offp));
+ fp = copy_flat_binder_object(t->buffer->data + deref_helper(offp));
switch (fp->type) {
case BINDER_TYPE_BINDER:
case BINDER_TYPE_WEAK_BINDER: {