* [PATCH 04/11] staging: dgnc: kfree for board structure in
@ 2016-09-22 5:22 ` Daeseok Youn
0 siblings, 0 replies; 11+ messages in thread
From: Daeseok Youn @ 2016-09-22 5:22 UTC (permalink / raw)
To: lidza.louina
Cc: markh, gregkh, driverdev-devel, devel, linux-kernel, kernel-janitors
The board structure should be freed when any function was failed
in dgnc_found_board(). And the board strucure will be stored
into dgnc_board array when the dgnc_found_board() function has no error.
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
drivers/staging/dgnc/dgnc_driver.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 58cebf4..0114e78 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -353,9 +353,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
int rc = 0;
/* get the board structure and prep it */
- dgnc_board[dgnc_num_boards] = kzalloc(sizeof(*brd), GFP_KERNEL);
- brd = dgnc_board[dgnc_num_boards];
-
+ brd = kzalloc(sizeof(*brd), GFP_KERNEL);
if (!brd)
return -ENOMEM;
@@ -411,7 +409,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
if (!brd->membase) {
dev_err(&brd->pdev->dev,
"Card has no PCI IO resources, failing.\n");
- return -ENODEV;
+ rc = -ENODEV;
+ goto failed;
}
brd->membase_end = pci_resource_end(pdev, 4);
@@ -502,7 +501,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
default:
dev_err(&brd->pdev->dev,
"Didn't find any compatible Neo/Classic PCI boards.\n");
- return -ENXIO;
+ rc = -ENXIO;
+ goto failed;
}
/*
@@ -539,14 +539,15 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
wake_up_interruptible(&brd->state_wait);
+ dgnc_board[dgnc_num_boards] = brd;
+
return 0;
failed:
dgnc_tty_uninit(brd);
- brd->state = BOARD_FAILED;
- brd->dpastatus = BD_NOFEP;
+ kfree(brd);
- return -ENXIO;
+ return rc;
}
static int dgnc_finalize_board_init(struct dgnc_board *brd)
--
1.9.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 04/11] staging: dgnc: kfree for board structure in
@ 2016-09-22 5:22 ` Daeseok Youn
0 siblings, 0 replies; 11+ messages in thread
From: Daeseok Youn @ 2016-09-22 5:22 UTC (permalink / raw)
To: lidza.louina
Cc: devel, gregkh, driverdev-devel, kernel-janitors, linux-kernel
The board structure should be freed when any function was failed
in dgnc_found_board(). And the board strucure will be stored
into dgnc_board array when the dgnc_found_board() function has no error.
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
drivers/staging/dgnc/dgnc_driver.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 58cebf4..0114e78 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -353,9 +353,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
int rc = 0;
/* get the board structure and prep it */
- dgnc_board[dgnc_num_boards] = kzalloc(sizeof(*brd), GFP_KERNEL);
- brd = dgnc_board[dgnc_num_boards];
-
+ brd = kzalloc(sizeof(*brd), GFP_KERNEL);
if (!brd)
return -ENOMEM;
@@ -411,7 +409,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
if (!brd->membase) {
dev_err(&brd->pdev->dev,
"Card has no PCI IO resources, failing.\n");
- return -ENODEV;
+ rc = -ENODEV;
+ goto failed;
}
brd->membase_end = pci_resource_end(pdev, 4);
@@ -502,7 +501,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
default:
dev_err(&brd->pdev->dev,
"Didn't find any compatible Neo/Classic PCI boards.\n");
- return -ENXIO;
+ rc = -ENXIO;
+ goto failed;
}
/*
@@ -539,14 +539,15 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
wake_up_interruptible(&brd->state_wait);
+ dgnc_board[dgnc_num_boards] = brd;
+
return 0;
failed:
dgnc_tty_uninit(brd);
- brd->state = BOARD_FAILED;
- brd->dpastatus = BD_NOFEP;
+ kfree(brd);
- return -ENXIO;
+ return rc;
}
static int dgnc_finalize_board_init(struct dgnc_board *brd)
--
1.9.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 04/11] staging: dgnc: kfree for board structure in
@ 2016-09-22 5:22 ` Daeseok Youn
0 siblings, 0 replies; 11+ messages in thread
From: Daeseok Youn @ 2016-09-22 5:22 UTC (permalink / raw)
To: lidza.louina
Cc: devel, gregkh, driverdev-devel, kernel-janitors, linux-kernel
The board structure should be freed when any function was failed
in dgnc_found_board(). And the board strucure will be stored
into dgnc_board array when the dgnc_found_board() function has no error.
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
drivers/staging/dgnc/dgnc_driver.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 58cebf4..0114e78 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -353,9 +353,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
int rc = 0;
/* get the board structure and prep it */
- dgnc_board[dgnc_num_boards] = kzalloc(sizeof(*brd), GFP_KERNEL);
- brd = dgnc_board[dgnc_num_boards];
-
+ brd = kzalloc(sizeof(*brd), GFP_KERNEL);
if (!brd)
return -ENOMEM;
@@ -411,7 +409,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
if (!brd->membase) {
dev_err(&brd->pdev->dev,
"Card has no PCI IO resources, failing.\n");
- return -ENODEV;
+ rc = -ENODEV;
+ goto failed;
}
brd->membase_end = pci_resource_end(pdev, 4);
@@ -502,7 +501,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
default:
dev_err(&brd->pdev->dev,
"Didn't find any compatible Neo/Classic PCI boards.\n");
- return -ENXIO;
+ rc = -ENXIO;
+ goto failed;
}
/*
@@ -539,14 +539,15 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
wake_up_interruptible(&brd->state_wait);
+ dgnc_board[dgnc_num_boards] = brd;
+
return 0;
failed:
dgnc_tty_uninit(brd);
- brd->state = BOARD_FAILED;
- brd->dpastatus = BD_NOFEP;
+ kfree(brd);
- return -ENXIO;
+ return rc;
}
static int dgnc_finalize_board_init(struct dgnc_board *brd)
--
1.9.1
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 04/11] staging: dgnc: kfree for board structure in
2016-09-22 5:22 ` Daeseok Youn
@ 2016-09-22 7:21 ` Greg KH
-1 siblings, 0 replies; 11+ messages in thread
From: Greg KH @ 2016-09-22 7:21 UTC (permalink / raw)
To: Daeseok Youn
Cc: lidza.louina, devel, driverdev-devel, kernel-janitors, linux-kernel
On Thu, Sep 22, 2016 at 02:22:03PM +0900, Daeseok Youn wrote:
> The board structure should be freed when any function was failed
> in dgnc_found_board(). And the board strucure will be stored
> into dgnc_board array when the dgnc_found_board() function has no error.
>
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
> drivers/staging/dgnc/dgnc_driver.c | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
Another shortened subject line.
Please look at all of the subjects in this series, fix them up, and
resend.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 04/11] staging: dgnc: kfree for board structure in
@ 2016-09-22 7:21 ` Greg KH
0 siblings, 0 replies; 11+ messages in thread
From: Greg KH @ 2016-09-22 7:21 UTC (permalink / raw)
To: Daeseok Youn
Cc: lidza.louina, devel, driverdev-devel, kernel-janitors, linux-kernel
On Thu, Sep 22, 2016 at 02:22:03PM +0900, Daeseok Youn wrote:
> The board structure should be freed when any function was failed
> in dgnc_found_board(). And the board strucure will be stored
> into dgnc_board array when the dgnc_found_board() function has no error.
>
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
> drivers/staging/dgnc/dgnc_driver.c | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
Another shortened subject line.
Please look at all of the subjects in this series, fix them up, and
resend.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 04/11] staging: dgnc: kfree for board structure in
2016-09-22 7:21 ` Greg KH
(?)
@ 2016-09-23 1:18 ` DaeSeok Youn
-1 siblings, 0 replies; 11+ messages in thread
From: DaeSeok Youn @ 2016-09-23 1:18 UTC (permalink / raw)
To: Greg KH
Cc: Lidza Louina, devel, driverdev-devel, kernel-janitors, linux-kernel
2016-09-22 16:21 GMT+09:00 Greg KH <gregkh@linuxfoundation.org>:
> On Thu, Sep 22, 2016 at 02:22:03PM +0900, Daeseok Youn wrote:
>> The board structure should be freed when any function was failed
>> in dgnc_found_board(). And the board strucure will be stored
>> into dgnc_board array when the dgnc_found_board() function has no error.
>>
>> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
>> ---
>> drivers/staging/dgnc/dgnc_driver.c | 17 +++++++++--------
>> 1 file changed, 9 insertions(+), 8 deletions(-)
>
> Another shortened subject line.
I am not sure why the subject line was cut off.
I will fix them up and resend.
Thanks.
Regards,
Daeseok.
>
> Please look at all of the subjects in this series, fix them up, and
> resend.
>
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 04/11] staging: dgnc: kfree for board structure in
@ 2016-09-23 1:18 ` DaeSeok Youn
0 siblings, 0 replies; 11+ messages in thread
From: DaeSeok Youn @ 2016-09-23 1:18 UTC (permalink / raw)
To: Greg KH
Cc: Lidza Louina, devel, driverdev-devel, kernel-janitors, linux-kernel
2016-09-22 16:21 GMT+09:00 Greg KH <gregkh@linuxfoundation.org>:
> On Thu, Sep 22, 2016 at 02:22:03PM +0900, Daeseok Youn wrote:
>> The board structure should be freed when any function was failed
>> in dgnc_found_board(). And the board strucure will be stored
>> into dgnc_board array when the dgnc_found_board() function has no error.
>>
>> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
>> ---
>> drivers/staging/dgnc/dgnc_driver.c | 17 +++++++++--------
>> 1 file changed, 9 insertions(+), 8 deletions(-)
>
> Another shortened subject line.
I am not sure why the subject line was cut off.
I will fix them up and resend.
Thanks.
Regards,
Daeseok.
>
> Please look at all of the subjects in this series, fix them up, and
> resend.
>
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 04/11] staging: dgnc: kfree for board structure in
@ 2016-09-23 1:18 ` DaeSeok Youn
0 siblings, 0 replies; 11+ messages in thread
From: DaeSeok Youn @ 2016-09-23 1:18 UTC (permalink / raw)
To: Greg KH
Cc: Lidza Louina, devel, driverdev-devel, kernel-janitors, linux-kernel
2016-09-22 16:21 GMT+09:00 Greg KH <gregkh@linuxfoundation.org>:
> On Thu, Sep 22, 2016 at 02:22:03PM +0900, Daeseok Youn wrote:
>> The board structure should be freed when any function was failed
>> in dgnc_found_board(). And the board strucure will be stored
>> into dgnc_board array when the dgnc_found_board() function has no error.
>>
>> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
>> ---
>> drivers/staging/dgnc/dgnc_driver.c | 17 +++++++++--------
>> 1 file changed, 9 insertions(+), 8 deletions(-)
>
> Another shortened subject line.
I am not sure why the subject line was cut off.
I will fix them up and resend.
Thanks.
Regards,
Daeseok.
>
> Please look at all of the subjects in this series, fix them up, and
> resend.
>
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 04/11] staging: dgnc: kfree for board structure in dgnc_found_board()
2016-09-22 5:22 ` Daeseok Youn
(?)
@ 2016-09-26 0:42 ` Daeseok Youn
-1 siblings, 0 replies; 11+ messages in thread
From: Daeseok Youn @ 2016-09-26 0:42 UTC (permalink / raw)
To: lidza.louina
Cc: markh, gregkh, driverdev-devel, devel, linux-kernel, kernel-janitors
The board structure should be freed when any function was failed
in dgnc_found_board(). And the board strucure will be stored
into dgnc_board array when the dgnc_found_board() function has no error.
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
RESEND: send the whole series again. Because I missed some patches
when the V2 patches sent.
V2: The subject line was cut off, I put it completely and update
change log.
drivers/staging/dgnc/dgnc_driver.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 58cebf4..0114e78 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -353,9 +353,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
int rc = 0;
/* get the board structure and prep it */
- dgnc_board[dgnc_num_boards] = kzalloc(sizeof(*brd), GFP_KERNEL);
- brd = dgnc_board[dgnc_num_boards];
-
+ brd = kzalloc(sizeof(*brd), GFP_KERNEL);
if (!brd)
return -ENOMEM;
@@ -411,7 +409,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
if (!brd->membase) {
dev_err(&brd->pdev->dev,
"Card has no PCI IO resources, failing.\n");
- return -ENODEV;
+ rc = -ENODEV;
+ goto failed;
}
brd->membase_end = pci_resource_end(pdev, 4);
@@ -502,7 +501,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
default:
dev_err(&brd->pdev->dev,
"Didn't find any compatible Neo/Classic PCI boards.\n");
- return -ENXIO;
+ rc = -ENXIO;
+ goto failed;
}
/*
@@ -539,14 +539,15 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
wake_up_interruptible(&brd->state_wait);
+ dgnc_board[dgnc_num_boards] = brd;
+
return 0;
failed:
dgnc_tty_uninit(brd);
- brd->state = BOARD_FAILED;
- brd->dpastatus = BD_NOFEP;
+ kfree(brd);
- return -ENXIO;
+ return rc;
}
static int dgnc_finalize_board_init(struct dgnc_board *brd)
--
1.9.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 04/11] staging: dgnc: kfree for board structure in dgnc_found_board()
@ 2016-09-26 0:42 ` Daeseok Youn
0 siblings, 0 replies; 11+ messages in thread
From: Daeseok Youn @ 2016-09-26 0:42 UTC (permalink / raw)
To: lidza.louina
Cc: devel, gregkh, driverdev-devel, kernel-janitors, linux-kernel
The board structure should be freed when any function was failed
in dgnc_found_board(). And the board strucure will be stored
into dgnc_board array when the dgnc_found_board() function has no error.
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
RESEND: send the whole series again. Because I missed some patches
when the V2 patches sent.
V2: The subject line was cut off, I put it completely and update
change log.
drivers/staging/dgnc/dgnc_driver.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 58cebf4..0114e78 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -353,9 +353,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
int rc = 0;
/* get the board structure and prep it */
- dgnc_board[dgnc_num_boards] = kzalloc(sizeof(*brd), GFP_KERNEL);
- brd = dgnc_board[dgnc_num_boards];
-
+ brd = kzalloc(sizeof(*brd), GFP_KERNEL);
if (!brd)
return -ENOMEM;
@@ -411,7 +409,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
if (!brd->membase) {
dev_err(&brd->pdev->dev,
"Card has no PCI IO resources, failing.\n");
- return -ENODEV;
+ rc = -ENODEV;
+ goto failed;
}
brd->membase_end = pci_resource_end(pdev, 4);
@@ -502,7 +501,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
default:
dev_err(&brd->pdev->dev,
"Didn't find any compatible Neo/Classic PCI boards.\n");
- return -ENXIO;
+ rc = -ENXIO;
+ goto failed;
}
/*
@@ -539,14 +539,15 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
wake_up_interruptible(&brd->state_wait);
+ dgnc_board[dgnc_num_boards] = brd;
+
return 0;
failed:
dgnc_tty_uninit(brd);
- brd->state = BOARD_FAILED;
- brd->dpastatus = BD_NOFEP;
+ kfree(brd);
- return -ENXIO;
+ return rc;
}
static int dgnc_finalize_board_init(struct dgnc_board *brd)
--
1.9.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 04/11] staging: dgnc: kfree for board structure in dgnc_found_board()
@ 2016-09-26 0:42 ` Daeseok Youn
0 siblings, 0 replies; 11+ messages in thread
From: Daeseok Youn @ 2016-09-26 0:42 UTC (permalink / raw)
To: lidza.louina
Cc: devel, gregkh, driverdev-devel, kernel-janitors, linux-kernel
The board structure should be freed when any function was failed
in dgnc_found_board(). And the board strucure will be stored
into dgnc_board array when the dgnc_found_board() function has no error.
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
RESEND: send the whole series again. Because I missed some patches
when the V2 patches sent.
V2: The subject line was cut off, I put it completely and update
change log.
drivers/staging/dgnc/dgnc_driver.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 58cebf4..0114e78 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -353,9 +353,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
int rc = 0;
/* get the board structure and prep it */
- dgnc_board[dgnc_num_boards] = kzalloc(sizeof(*brd), GFP_KERNEL);
- brd = dgnc_board[dgnc_num_boards];
-
+ brd = kzalloc(sizeof(*brd), GFP_KERNEL);
if (!brd)
return -ENOMEM;
@@ -411,7 +409,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
if (!brd->membase) {
dev_err(&brd->pdev->dev,
"Card has no PCI IO resources, failing.\n");
- return -ENODEV;
+ rc = -ENODEV;
+ goto failed;
}
brd->membase_end = pci_resource_end(pdev, 4);
@@ -502,7 +501,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
default:
dev_err(&brd->pdev->dev,
"Didn't find any compatible Neo/Classic PCI boards.\n");
- return -ENXIO;
+ rc = -ENXIO;
+ goto failed;
}
/*
@@ -539,14 +539,15 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
wake_up_interruptible(&brd->state_wait);
+ dgnc_board[dgnc_num_boards] = brd;
+
return 0;
failed:
dgnc_tty_uninit(brd);
- brd->state = BOARD_FAILED;
- brd->dpastatus = BD_NOFEP;
+ kfree(brd);
- return -ENXIO;
+ return rc;
}
static int dgnc_finalize_board_init(struct dgnc_board *brd)
--
1.9.1
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2016-09-26 0:44 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-22 5:22 [PATCH 04/11] staging: dgnc: kfree for board structure in Daeseok Youn
2016-09-22 5:22 ` Daeseok Youn
2016-09-22 5:22 ` Daeseok Youn
2016-09-22 7:21 ` Greg KH
2016-09-22 7:21 ` Greg KH
2016-09-23 1:18 ` DaeSeok Youn
2016-09-23 1:18 ` DaeSeok Youn
2016-09-23 1:18 ` DaeSeok Youn
2016-09-26 0:42 [PATCH 04/11] staging: dgnc: kfree for board structure in dgnc_found_board() Daeseok Youn
2016-09-26 0:42 ` Daeseok Youn
2016-09-26 0:42 ` Daeseok Youn
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.