[PATCH] mm/hmm: fix major device driver exhaustion (dumb cut and paste mistake)
From: JÃrÃme Glisse
Date: Mon Jul 10 2017 - 19:39:24 EST
This is likely the result of some cut and paste gone wrong.
Signed-off-by: Jéme Glisse <jglisse@xxxxxxxxxx>
---
mm/hmm.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/mm/hmm.c b/mm/hmm.c
index 28e54e3..6d1705a 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -1206,18 +1206,11 @@ static void hmm_device_release(struct device *device)
struct hmm_device *hmm_device_new(void *drvdata)
{
struct hmm_device *hmm_device;
- int ret;
hmm_device = kzalloc(sizeof(*hmm_device), GFP_KERNEL);
if (!hmm_device)
return ERR_PTR(-ENOMEM);
- ret = alloc_chrdev_region(&hmm_device->device.devt, 0, 1, "hmm_device");
- if (ret < 0) {
- kfree(hmm_device);
- return NULL;
- }
-
spin_lock(&hmm_device_lock);
hmm_device->minor = find_first_zero_bit(hmm_device_mask, HMM_DEVICE_MAX);
if (hmm_device->minor >= HMM_DEVICE_MAX) {
--
2.9.4
--9jxsPFA5p3P2qPhR--