drbd: fix memory leak
authorDan Carpenter <error27@gmail.com>
Thu, 22 Apr 2010 12:27:23 +0000 (14:27 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 22 Apr 2010 12:27:23 +0000 (14:27 +0200)
We leak memory if "--dry-run" is not supported by the peer.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
drivers/block/drbd/drbd_main.c

index 67e0fc5..93d1f9b 100644 (file)
@@ -1695,6 +1695,7 @@ int drbd_send_protocol(struct drbd_conf *mdev)
                        cf |= CF_DRY_RUN;
                else {
                        dev_err(DEV, "--dry-run is not supported by peer");
+                       kfree(p);
                        return 0;
                }
        }