nfsd: simplify fh_verify access checks
[safe/jmp/linux-2.6] / drivers / char / hvc_iucv.c
index 86105ef..b8a5d65 100644 (file)
@@ -273,7 +273,9 @@ static int hvc_iucv_write(struct hvc_iucv_private *priv,
        case MSG_TYPE_WINSIZE:
                if (rb->mbuf->datalen != sizeof(struct winsize))
                        break;
-               hvc_resize(priv->hvc, *((struct winsize *) rb->mbuf->data));
+               /* The caller must ensure that the hvc is locked, which
+                * is the case when called from hvc_iucv_get_chars() */
+               __hvc_resize(priv->hvc, *((struct winsize *) rb->mbuf->data));
                break;
 
        case MSG_TYPE_ERROR:    /* ignored ... */
@@ -1006,7 +1008,7 @@ static int __init hvc_iucv_alloc(int id, unsigned int is_console)
        priv->dev->release = (void (*)(struct device *)) kfree;
        rc = device_register(priv->dev);
        if (rc) {
-               kfree(priv->dev);
+               put_device(priv->dev);
                goto out_error_dev;
        }