On Wed, Oct 24, 2012 at 2:04 AM, Devendra Naga <[email protected]> wrote:
> this takes up the error path cleanup,
> fixes a crash too due to null deref
>
> Signed-off-by: Devendra Naga <[email protected]>
> ---
>  drivers/staging/slicoss/slicoss.c |    2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/staging/slicoss/slicoss.c 
> b/drivers/staging/slicoss/slicoss.c
> index 9454280..f6af3fe 100644
> --- a/drivers/staging/slicoss/slicoss.c
> +++ b/drivers/staging/slicoss/slicoss.c
> @@ -3667,6 +3667,8 @@ static u32 slic_card_locate(struct adapter *adapter)
>         if (!physcard) {
>                 /* no structure allocated for this physical card yet */
>                 physcard = kzalloc(sizeof(struct physcard), GFP_ATOMIC);
> +               if (!physcard)
> +                       return -ENOMEM;

You have not released the card pointer allocated earlier.


>
>                 physcard->next = slic_global.phys_card;
>                 slic_global.phys_card = physcard;
> --
> 1.7.9.5
>
> _______________________________________________
> devel mailing list
> [email protected]
> http://driverdev.linuxdriverproject.org/mailman/listinfo/devel



-- 
Regards,
Denis
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to