Coccinelle archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: kernel-janitors@vger.kernel.org, linux-media@vger.kernel.org,
	Andy Walls <awalls@md.metrocast.net>,
	Hans Verkuil <hverkuil@xs4all.nl>, Helge Deller <deller@gmx.de>,
	"John P. Harvey" <john.p.harvey@btinternet.com>,
	Kevin Thayer <nufan_wfk@yahoo.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, cocci@inria.fr
Subject: [cocci] [PATCH] media: ivtv: Fix exception handling in ivtvfb_init_vidmode()
Date: Wed, 24 May 2023 08:56:19 +0200	[thread overview]
Message-ID: <9f036fbd-5aa1-6336-fdf4-50952e882eaa@web.de> (raw)

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 24 May 2023 08:30:10 +0200

The exception handling was incomplete.

Call also the function “fb_dealloc_cmap” after a call of
the function “kmalloc_array” failed here.

Fixes: 32db77545281 ("V4L/DVB (5902): Add ivtv-fb framebuffer driver.")
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/media/pci/ivtv/ivtvfb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/pci/ivtv/ivtvfb.c b/drivers/media/pci/ivtv/ivtvfb.c
index 0aeb9daaee4c..7d6a8065220c 100644
--- a/drivers/media/pci/ivtv/ivtvfb.c
+++ b/drivers/media/pci/ivtv/ivtvfb.c
@@ -1073,6 +1073,7 @@ static int ivtvfb_init_vidmode(struct ivtv *itv)

 	if (!oi->ivtvfb_info.pseudo_palette) {
 		IVTVFB_ERR("abort, unable to alloc pseudo palette\n");
+		fb_dealloc_cmap(&oi->ivtvfb_info.cmap);
 		return -ENOMEM;
 	}

--
2.40.1


                 reply	other threads:[~2023-05-24  6:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f036fbd-5aa1-6336-fdf4-50952e882eaa@web.de \
    --to=markus.elfring@web.de \
    --cc=awalls@md.metrocast.net \
    --cc=cocci@inria.fr \
    --cc=deller@gmx.de \
    --cc=hverkuil@xs4all.nl \
    --cc=john.p.harvey@btinternet.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nufan_wfk@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).