@@ -177,7 +177,7 @@ static int open_getadapter_fib(struct aac_dev * dev, void __user *arg)
struct aac_fib_context * fibctx;
int status;
- fibctx = kmalloc(sizeof(struct aac_fib_context), GFP_KERNEL);
+ fibctx = kmalloc(sizeof(*fibctx), GFP_KERNEL);
if (fibctx == NULL) {
status = -ENOMEM;
} else {
@@ -186,7 +186,7 @@ static int open_getadapter_fib(struct aac_dev * dev, void __user *arg)
struct aac_fib_context * context;
fibctx->type = FSAFS_NTC_GET_ADAPTER_FIB_CONTEXT;
- fibctx->size = sizeof(struct aac_fib_context);
+ fibctx->size = sizeof(*fibctx);
/*
* Yes yes, I know this could be an index, but we have a
* better guarantee of uniqueness for the locked loop below.
@@ -251,7 +251,7 @@ static int next_getadapter_fib(struct aac_dev * dev, void __user *arg)
struct list_head * entry;
unsigned long flags;
- if (copy_from_user((void *)&f, arg, sizeof(struct fib_ioctl)))
+ if (copy_from_user(&f, arg, sizeof(f)))
return -EFAULT;
/*
* Verify that the HANDLE passed in was a valid AdapterFibContext
@@ -509,7 +509,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
srbcmd = (struct aac_srb*) fib_data(srbfib);
memset(sg_list, 0, sizeof(sg_list)); /* cleanup may take issue */
- if (copy_from_user(&fibsize, &user_srb->count, sizeof(u32))) {
+ if (copy_from_user(&fibsize, &user_srb->count, sizeof(fibsize))) {
dprintk((KERN_DEBUG"aacraid: Could not copy data size from user\n"));
rcode = -EFAULT;
goto free_sg_list;