Commit 077c28f8 authored by Mark Hounschell's avatar Mark Hounschell Committed by Greg Kroah-Hartman

staging: dgap: Fix how we insure config data is a string

This patch changes the way we insure the config data
is a string. Clearly this was just wrong. After a
certain number of loads/unloads various OOPs were
generated indicating something other than this driver
had a problem. It was this driver.
Signed-off-by: default avatarMark Hounschell <markh@compro.net>
Tested-by: default avatarMark Hounschell <markh@compro.net>
Reported-by: default avatarMark Hounschell <markh@compro.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent abeb935f
......@@ -834,7 +834,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
return ret;
}
dgap_config_buf = kmalloc(fw->size + 1, GFP_KERNEL);
dgap_config_buf = kzalloc(fw->size + 1, GFP_KERNEL);
if (!dgap_config_buf) {
release_firmware(fw);
return -ENOMEM;
......@@ -842,7 +842,6 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
memcpy(dgap_config_buf, fw->data, fw->size);
release_firmware(fw);
dgap_config_buf[fw->size + 1] = '\0';
if (dgap_parsefile(&dgap_config_buf, TRUE) != 0) {
kfree(dgap_config_buf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment