misc: mic: silence an overflow warning
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 12 Feb 2016 06:44:34 +0000 (09:44 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Feb 2016 01:42:37 +0000 (17:42 -0800)
Static checkers complain that the this is a potential array overflow.
We verify that it's not on the next line so this code is OK, but
static checker warnings are annoying.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mic/vop/vop_vringh.c

index c3613f39eb352b16539154a9f711fd90725c415a..e94c7fb6712aab35a1a3278241c3bab494f68777 100644 (file)
@@ -848,12 +848,13 @@ static int vop_virtio_copy_desc(struct vop_vdev *vdev,
                                struct mic_copy_desc *copy)
 {
        int err;
-       struct vop_vringh *vvr = &vdev->vvr[copy->vr_idx];
+       struct vop_vringh *vvr;
 
        err = vop_verify_copy_args(vdev, copy);
        if (err)
                return err;
 
+       vvr = &vdev->vvr[copy->vr_idx];
        mutex_lock(&vvr->vr_mutex);
        if (!vop_vdevup(vdev)) {
                err = -ENODEV;