public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Linux Media Mailing List <linux-media@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: [PATCH 00/11] Some smatch fixups
Date: Fri,  5 Jun 2015 11:27:31 -0300	[thread overview]
Message-ID: <cover.1433514004.git.mchehab@osg.samsung.com> (raw)

Fix several smatch warnings.

There are only 26 smatch warnings now:

drivers/media/pci/cx23885/cx23885-dvb.c:2046 dvb_register() Function too hairy.  Giving up.

	This is actually a memory allocation limit of 50MB at smatch.
	I sent a patch changing such limit to 200MB to Dan.

drivers/media/dvb-frontends/stv0900_core.c:1183 stv0900_get_optim_carr_loop() error: buffer overflow 'cllas2' 11 <= 13
drivers/media/dvb-frontends/stv0900_core.c:1185 stv0900_get_optim_carr_loop() error: buffer overflow 'cllas2' 11 <= 13
drivers/media/dvb-frontends/stv0900_core.c:1187 stv0900_get_optim_carr_loop() error: buffer overflow 'cllas2' 11 <= 13
drivers/media/dvb-frontends/stv0900_core.c:1189 stv0900_get_optim_carr_loop() error: buffer overflow 'cllas2' 11 <= 13
drivers/media/dvb-frontends/stv0900_core.c:1191 stv0900_get_optim_carr_loop() error: buffer overflow 'cllas2' 11 <= 13
drivers/media/media-entity.c:238:17: warning: Variable length array is used.
drivers/media/media-entity.c:239:17: warning: Variable length array is used.
drivers/media/pci/ttpci/av7110.c:2210 frontend_init() warn: missing break? reassigning 'av7110->fe'
drivers/media/pci/ttpci/budget.c:631 frontend_init() warn: missing break? reassigning 'budget->dvb_frontend'
drivers/media/platform/vivid/vivid-rds-gen.c:82 vivid_rds_generate() error: buffer overflow 'rds->psname' 9 <= 43
drivers/media/platform/vivid/vivid-rds-gen.c:83 vivid_rds_generate() error: buffer overflow 'rds->psname' 9 <= 42
drivers/media/platform/vivid/vivid-rds-gen.c:89 vivid_rds_generate() error: buffer overflow 'rds->radiotext' 65 <= 84
drivers/media/platform/vivid/vivid-rds-gen.c:90 vivid_rds_generate() error: buffer overflow 'rds->radiotext' 65 <= 85
drivers/media/platform/vivid/vivid-rds-gen.c:92 vivid_rds_generate() error: buffer overflow 'rds->radiotext' 65 <= 86
drivers/media/platform/vivid/vivid-rds-gen.c:93 vivid_rds_generate() error: buffer overflow 'rds->radiotext' 65 <= 87
drivers/media/radio/radio-aimslab.c:73 rtrack_alloc() warn: possible memory leak of 'rt'
drivers/media/radio/radio-aztech.c:87 aztech_alloc() warn: possible memory leak of 'az'
drivers/media/radio/radio-gemtek.c:189 gemtek_alloc() warn: possible memory leak of 'gt'
drivers/media/radio/radio-trust.c:60 trust_alloc() warn: possible memory leak of 'tr'
drivers/media/radio/radio-typhoon.c:79 typhoon_alloc() warn: possible memory leak of 'ty'
drivers/media/radio/radio-zoltrix.c:83 zoltrix_alloc() warn: possible memory leak of 'zol'
drivers/media/usb/pvrusb2/pvrusb2-encoder.c:227 pvr2_encoder_cmd() error: buffer overflow 'wrData' 16 <= 16
drivers/media/usb/pvrusb2/pvrusb2-hdw.c:3676 pvr2_send_request_ex() error: we previously assumed 'write_data' could be null (see line 3648)
drivers/media/usb/pvrusb2/pvrusb2-hdw.c:3829 pvr2_send_request_ex() error: we previously assumed 'read_data' could be null (see line 3649)

  Those seem to be false positives that would require a bigger logic
  change (or some change at smatch side). Probably not worth to touch
  the driver code.

drivers/media/pci/ivtv/ivtv-queue.c:145 ivtv_queue_move() error: we previously assumed 'steal' could be null (see line 138)
  I suspect that this is a real bug and should be addressed.
  Fixing it would require some tests with the hardware, and a better
  understanding on what the function should be expecting to do when 
  "steal" is NULL.

Mauro Carvalho Chehab (11):
  [media] drxk: better handle errors
  [media] em28xx: remove dead code
  [media] sh_vou: avoid going past arrays
  [media] dib0090: Remove a dead code
  [media] bt8xx: remove needless check
  [media] ivtv: fix two smatch warnings
  [media] tm6000: remove needless check
  [media] ir: Fix IR_MAX_DURATION enforcement
  [media] rc: set IR_MAX_DURATION to 500 ms
  [media] usbvision: cleanup the code
  [media] lirc_imon: simplify error handling code

 drivers/media/dvb-frontends/dib0090.c         |   4 +-
 drivers/media/dvb-frontends/drxk_hard.c       |   7 +-
 drivers/media/pci/bt8xx/dst_ca.c              | 132 +++++++++++++-------------
 drivers/media/pci/ivtv/ivtv-driver.h          |   3 +-
 drivers/media/platform/sh_vou.c               |  14 +--
 drivers/media/rc/redrat3.c                    |   5 +-
 drivers/media/rc/streamzap.c                  |   6 +-
 drivers/media/usb/em28xx/em28xx-video.c       |   1 -
 drivers/media/usb/tm6000/tm6000-video.c       |   2 +-
 drivers/media/usb/usbvision/usbvision-video.c |  17 +++-
 drivers/staging/media/lirc/lirc_imon.c        |  95 ++++++++----------
 include/media/rc-core.h                       |   2 +-
 12 files changed, 139 insertions(+), 149 deletions(-)

-- 
2.4.2


             reply	other threads:[~2015-06-05 14:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-05 14:27 Mauro Carvalho Chehab [this message]
2015-06-05 14:27 ` [PATCH 0/9] Some smatch fixups Mauro Carvalho Chehab
2015-06-05 14:43   ` Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 01/11] [media] drxk: better handle errors Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 02/11] [media] em28xx: remove dead code Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 03/11] [media] sh_vou: avoid going past arrays Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 04/11] [media] dib0090: Remove a dead code Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 05/11] [media] bt8xx: remove needless check Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 06/11] [media] ivtv: fix two smatch warnings Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 07/11] [media] tm6000: remove needless check Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 08/11] [media] ir: Fix IR_MAX_DURATION enforcement Mauro Carvalho Chehab
2015-06-05 14:55   ` Sean Young
2015-06-05 15:00     ` Sean Young
2015-06-05 15:04       ` Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 09/11] [media] rc: set IR_MAX_DURATION to 500 ms Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 10/11] [media] usbvision: cleanup the code Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 11/11] [media] lirc_imon: simplify error handling code Mauro Carvalho Chehab

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=cover.1433514004.git.mchehab@osg.samsung.com \
    --to=mchehab@osg.samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /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