id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
29ae07b702cb77dbc24b0843f15ee8cf8a642311
Analyze and fix the following issue in the Linux kernel code: ext4: Fix overflow caused by missing cast in ext4_fallocate()
Problem Details: The logical block number in map.l_blk is a __u32, and so before we shift it left, by the block size, we neeed cast it to a 64-bit size. Otherwise i_size can be corrupted on an ENOSPC. # df -T /mnt/mp1 Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/sda6 ext4 9843276 ...
```diff diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index a25bbdc7d493..57cf568a98ab 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -3824,7 +3824,7 @@ retry: blkbits) >> blkbits)) new_size = offset + len; else - new_size = (map.m_lblk + ret) << blkbits; + new_size = ((loff_t) map.m_l...
f84ee364dd15af11cada1e673f94128f62db189e
Analyze and fix the following issue in the Linux kernel code: md/raid10: attempt to fix read errors during resync/check
Problem Details: We already attempt to fix read errors found during normal IO and a 'repair' process. It is best to try to repair them at any time they are found, so move a test so that during sync and check a read error will be corrected by over-writing with good data. If both (all) devices have known bad blocks in t...
```diff diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 909450414c67..10415ddfcb42 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1541,11 +1541,12 @@ static void sync_request_write(mddev_t *mddev, r10bio_t *r10_bio) if (j == vcnt) continue; mddev->resync_mismatches += r10_bio->...
31c176ecdf3563140e6395249eda51a18130d9f6
Analyze and fix the following issue in the Linux kernel code: md/raid5: avoid reading from known bad blocks.
Problem Details: There are two times that we might read in raid5: 1/ when a read request fits within a chunk on a single working device. In this case, if there is any bad block in the range of the read, we simply fail the cache-bypass read and perform the read though the stripe cache. 2/ when reading into ...
```diff diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 304389ba5e27..a2d68389ee75 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -2923,6 +2923,9 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s) spin_lock_irq(&conf->device_lock); for (i=disks; i--; ) { md...
0b7d83865cb7a60b1768212c1e60b8fd7c280506
Analyze and fix the following issue in the Linux kernel code: md: update documentation for md/rdev/state sysfs interface
Problem Details: Previous patches in the bad block series extended behavior of rdev's 'state' interface but lacked documentation update. Fix it. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
```diff diff --git a/Documentation/md.txt b/Documentation/md.txt index 923a6bddce7c..fc94770f44ab 100644 --- a/Documentation/md.txt +++ b/Documentation/md.txt @@ -360,18 +360,20 @@ Each directory contains: A file recording the current state of the device in the array which can be a comma separated list of ...
0e1147b001793593624e80b3c0a1790822b6baca
Analyze and fix the following issue in the Linux kernel code: ext4: add action of moving index in ext4_ext_rm_idx for Punch Hole
Problem Details: The old function ext4_ext_rm_idx is used only for truncate case because it just remove last index in extent-index-block. When punching hole, it usually needed to remove "middle" index, therefore we must move indexes which after it forward. (I create a file with 1 depth extent tree and punch hole in th...
```diff diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 4d73e11ae883..a25bbdc7d493 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -2101,8 +2101,6 @@ ext4_ext_in_cache(struct inode *inode, ext4_lblk_t block, /* * ext4_ext_rm_idx: * removes index from the index block. - * It's used in truncate ca...
86cf786c04541c18febc897686a0d5bea29ce688
Analyze and fix the following issue in the Linux kernel code: [media] v4l: mt9v032: Fix Bayer pattern
Problem Details: Compute crop rectangle boundaries to ensure a GRBG Bayer pattern. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/mt9v032.c b/drivers/media/video/mt9v032.c index 1319c2c48aff..c64e1dc4cb4e 100644 --- a/drivers/media/video/mt9v032.c +++ b/drivers/media/video/mt9v032.c @@ -31,14 +31,14 @@ #define MT9V032_CHIP_VERSION 0x00 #define MT9V032_CHIP_ID_REV1 0x1311 #define MT9V032_CHIP_ID_R...
9c56cbf9aadff79c25ccd424ae422971efd5c1a4
Analyze and fix the following issue in the Linux kernel code: [media] V4L: mt9m111: fix missing return value check mt9m111_reg_clear
Problem Details: Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c index cbccc869c7e1..8d8420acc9cf 100644 --- a/drivers/media/video/mt9m111.c +++ b/drivers/media/video/mt9m111.c @@ -250,7 +250,9 @@ static int mt9m111_reg_clear(struct i2c_client *client, const u16 reg, int ret; ret = mt9m111_reg_r...
cb74cf5349a6a9225bbab278a808d5a0739c3b2c
Analyze and fix the following issue in the Linux kernel code: [media] V4L: sh_mobile_ceu_camera: fix Oops when USERPTR mapping fails
Problem Details: If vb2_dma_contig_get_userptr() fails on a videobuffer, driver's .buf_init() method will not be called and the list will not be initialised. Trying to remove an uninitialised element from a list leads to a NULL-dereference. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Tested-by: Bastia...
```diff diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c index f86550703f8e..e54089802b6b 100644 --- a/drivers/media/video/sh_mobile_ceu_camera.c +++ b/drivers/media/video/sh_mobile_ceu_camera.c @@ -422,8 +422,12 @@ static void sh_mobile_ceu_videobuf_release(struct vb...
de99d5328c6d54694471da28711a05adec708c3b
Analyze and fix the following issue in the Linux kernel code: [media] cx231xx: Provide signal lock status in G_INPUT
Problem Details: Make use of the signal state registers to properly populate the signal lock registers in the cx231xx driver. This allows applications to know whether there is a signal present even in devices which lack a tuner (since such apps typically won't call G_TUNER if no tuner is present). [mchehab@redhat.com...
```diff diff --git a/drivers/media/video/cx231xx/cx231xx-video.c b/drivers/media/video/cx231xx/cx231xx-video.c index 21fa54762be7..6e81f970dc7d 100644 --- a/drivers/media/video/cx231xx/cx231xx-video.c +++ b/drivers/media/video/cx231xx/cx231xx-video.c @@ -1179,7 +1179,8 @@ static int vidioc_enum_input(struct file *file,...
44ecf1df9493e6684cd1bb34abb107a0ffe1078a
Analyze and fix the following issue in the Linux kernel code: [media] cx231xx: Fix power ramping issue
Problem Details: On platforms that have CONFIG_HZ set to 100, the power ramp time effectively ends up being 10ms. However, on those that have a higher CONFIG_HZ, the time ends up *actually* being 5ms, which doesn't allow enough time for the hardware to be fully powered up before attempting to address it via i2c. Chan...
```diff diff --git a/drivers/media/video/cx231xx/cx231xx.h b/drivers/media/video/cx231xx/cx231xx.h index c8d0d3dee798..2000bc64c497 100644 --- a/drivers/media/video/cx231xx/cx231xx.h +++ b/drivers/media/video/cx231xx/cx231xx.h @@ -43,7 +43,7 @@ #include "cx231xx-conf-reg.h" #define DRIVER_NAME "...
992299e84a4891275ea5924e30b66ce39a701e5e
Analyze and fix the following issue in the Linux kernel code: [media] Fix regression introduced which broke the Hauppauge USBLive 2
Problem Details: The following patch addresses the regression introduced in the cx231xx driver which stopped the Hauppauge USBLive2 from working. Confirmed working by both myself and the user who reported the issue on the KernelLabs blog (Robert DeLuca). At some point during refactoring of the cx231xx driver, the USB...
```diff diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c index 9a07d3df3e20..53dae2a8272d 100644 --- a/drivers/media/video/cx231xx/cx231xx-cards.c +++ b/drivers/media/video/cx231xx/cx231xx-cards.c @@ -387,6 +387,7 @@ struct cx231xx_board cx231xx_boards[] = { .nor...
c0c5e71e46638e5264c193db8636132e036a4c56
Analyze and fix the following issue in the Linux kernel code: [media] uvcvideo: Fix control mapping for devices with multiple chains
Problem Details: The search for matching extension units fails to take account of the current chain. In the case where you have two distinct video chains, both containing an XU with the same GUID but different unit ids, you will be unable to perform a mapping on the second chain because entity on the first chain will ...
```diff diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c index a4db26fa2f53..53e82753cbca 100644 --- a/drivers/media/video/uvc/uvc_ctrl.c +++ b/drivers/media/video/uvc/uvc_ctrl.c @@ -1664,8 +1664,8 @@ int uvc_ctrl_add_mapping(struct uvc_video_chain *chain, return -EINVAL; } - ...
119faf90ed79adfd4a8930f62c3b9592adf5d250
Analyze and fix the following issue in the Linux kernel code: [media] drxk: Fix the logic that selects between DVB-C annex A and C
Problem Details: Fix the DRX-K logic that selects between DVB-C annex A and C Fix a typo where DVB-C annex type is set via setEnvParameters, but the driver, uses, instead, setParamParameters[2]. While here, cleans up the code, fixing a bad identation at the fallback code for other types of firmware, and put the multi...
```diff diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c index 85332e830447..41b083820dae 100644 --- a/drivers/media/dvb/frontends/drxk_hard.c +++ b/drivers/media/dvb/frontends/drxk_hard.c @@ -5382,18 +5382,16 @@ static int SetQAM(struct drxk_state *state, u16 IntermediateF...
f07a0bc111829707f1277c19467a7129ddb5aeb1
Analyze and fix the following issue in the Linux kernel code: [media] drxk: Fix read debug message
Problem Details: Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c index 5b22c1f9c266..85332e830447 100644 --- a/drivers/media/dvb/frontends/drxk_hard.c +++ b/drivers/media/dvb/frontends/drxk_hard.c @@ -355,13 +355,7 @@ static int i2c_read(struct i2c_adapter *adap, {.addr = adr, ....
e716adacef360fde5a5327ee95aa33dfca276c61
Analyze and fix the following issue in the Linux kernel code: [media] drxk: Fix error return code during drxk init
Problem Details: Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c index 56949553b929..5b22c1f9c266 100644 --- a/drivers/media/dvb/frontends/drxk_hard.c +++ b/drivers/media/dvb/frontends/drxk_hard.c @@ -6171,7 +6171,7 @@ error: if (status < 0) printk(KERN_ERR "drxk: Error %d on ...
320ed23ebf135a3403a7068ede7ca7915675bd47
Analyze and fix the following issue in the Linux kernel code: [media] drxk: Fix a bug at some switches that broke DVB-T
Problem Details: The error propagation changeset c23bf4402 broke the DVB-T code. The legacy way for propagate errors was: do { status = foo_func() if (status < 0) break; } while (0); return status; However, on a few places, it was doing: do { switch(foo) { case bar: status = foo_func() if (status < 0) b...
```diff diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c index a0e2ff51263e..217796dd49bf 100644 --- a/drivers/media/dvb/frontends/drxk_hard.c +++ b/drivers/media/dvb/frontends/drxk_hard.c @@ -3451,13 +3451,13 @@ static int DVBTCtrlSetEchoThreshold(struct drxk_state *state,...
c4c3a3d32a2eac18dba04683bb5b7357402405c7
Analyze and fix the following issue in the Linux kernel code: [media] Remove the double symbol increment hack from drxk_hard
Problem Details: Both ngene and ddbrige calls dvb_attach once for drxk_attach. The logic used there, and by tda18271c2dd driver is different from similar logic on other frontends. The right fix is to change them to use the same logic, but, while we don't do that, we need to patch em28xx-dvb in order to do cope with ng...
```diff diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c index d5035586ff62..a0e2ff51263e 100644 --- a/drivers/media/dvb/frontends/drxk_hard.c +++ b/drivers/media/dvb/frontends/drxk_hard.c @@ -6313,12 +6313,10 @@ static int drxk_c_get_tune_settings(struct dvb_frontend *fe, ...
8afe9119e25809b044d9b5afbe2fb2853a5bd10c
Analyze and fix the following issue in the Linux kernel code: [media] media, Micronas dvb-t: Fix mem leaks, don't needlessly zero mem, fix spelling
Problem Details: In drivers/media/dvb/frontends/drxd_hard.c::load_firmware() I see 3 small issues: 1) When the 'fw' variable goes out of scope we'll leak the memory allocated to it by request_firmware() by neglecting to call release_firmware(). 2) After a successful request_firmware() we allocate fw->size bytes ...
```diff diff --git a/drivers/media/dvb/frontends/drxd_hard.c b/drivers/media/dvb/frontends/drxd_hard.c index d7afa3493f1e..2238bf0be959 100644 --- a/drivers/media/dvb/frontends/drxd_hard.c +++ b/drivers/media/dvb/frontends/drxd_hard.c @@ -909,14 +909,16 @@ static int load_firmware(struct drxd_state *state, const char *...
37f9619dd5df9f1c9878ac53e27033519b8760ec
Analyze and fix the following issue in the Linux kernel code: [media] TM6000: alsa: Clean up kernel coding style errors
Problem Details: There were several coding style errors as reported by checkpatch.pl. This patch should fix those errors with the single exception of the open square bracket issue on line 45. [mchehab@redhat.com: Fix a merge conflict] Signed-off-by: Adam M. Dutko <dutko.adam@gmail.com> Signed-off-by: Mauro Carvalho Ch...
```diff diff --git a/drivers/staging/tm6000/tm6000-alsa.c b/drivers/staging/tm6000/tm6000-alsa.c index a588f299af49..018ff73ab71d 100644 --- a/drivers/staging/tm6000/tm6000-alsa.c +++ b/drivers/staging/tm6000/tm6000-alsa.c @@ -18,7 +18,7 @@ #include <linux/slab.h> #include <linux/vmalloc.h> -#include <asm/delay.h> ...
731884ba61d414563a75a5795f140432d786420f
Analyze and fix the following issue in the Linux kernel code: [media] tea5764: Fix module parameter permissions
Problem Details: The third parameter of module_param is supposed to represent sysfs file permissions. A value of "1" leads to the following: $ ls -l /sys/module/radio_tea5764/parameters/ total 0 I am changing it to "0" to align with the other module parameters in this driver. Signed-off-by: Jean Delvare <jdelvare@su...
```diff diff --git a/drivers/media/radio/radio-tea5764.c b/drivers/media/radio/radio-tea5764.c index ce75c3ae5670..95ddcc4845d3 100644 --- a/drivers/media/radio/radio-tea5764.c +++ b/drivers/media/radio/radio-tea5764.c @@ -594,7 +594,7 @@ MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); MODULE_VERSION(DRIVER_V...
01434faf6d82f791c701d299f898bf261a724342
Analyze and fix the following issue in the Linux kernel code: tda18271c2dd: Fix compilation when module is not selected
Problem Details: Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/frontends/tda18271c2dd.h b/drivers/media/dvb/frontends/tda18271c2dd.h index d8af25d8b703..1389c74e12ce 100644 --- a/drivers/media/dvb/frontends/tda18271c2dd.h +++ b/drivers/media/dvb/frontends/tda18271c2dd.h @@ -6,7 +6,7 @@ struct dvb_frontend *tda18271c2dd_attach(struct dvb_front...
5eee2bb270e34b2e8b245838faef3f9455c69ce6
Analyze and fix the following issue in the Linux kernel code: [media] drxk: Add a fallback method for QAM parameter setting
Problem Details: The QAM standard is set using this scu_command: SCU_RAM_COMMAND_STANDARD_QAM | SCU_RAM_COMMAND_CMD_DEMOD_SET_PARAM The driver implements a version that has 4 parameters, however, Terratec H5 needs to break this into two separate commands, otherwise, DVB-C doesn't work. With this fix, scan is now pr...
```diff diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c index 5745f526f391..f74a17641278 100644 --- a/drivers/media/dvb/frontends/drxk_hard.c +++ b/drivers/media/dvb/frontends/drxk_hard.c @@ -5389,7 +5389,7 @@ static int SetQAM(struct drxk_state *state, u16 IntermediateFre...
cf694b141ea2973179756fd572dd5cdd064e1abf
Analyze and fix the following issue in the Linux kernel code: [media] drxk: Fix driver removal
Problem Details: Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c index aaef8e35698b..7ea73dfacdfb 100644 --- a/drivers/media/dvb/frontends/drxk_hard.c +++ b/drivers/media/dvb/frontends/drxk_hard.c @@ -6431,6 +6431,18 @@ struct dvb_frontend *drxk_attach(const struct drxk_config *con...
147e110bb69a5eaee83bab133d7f7cc4ee050808
Analyze and fix the following issue in the Linux kernel code: [media] drxk: Fix the antenna switch logic
Problem Details: Terratec H5 doesn't require to switch mode, but generates an error due to this logic. Also, GPIO's are board-dependent. So, add it at the board config struct. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/frontends/drxk.h b/drivers/media/dvb/frontends/drxk.h index 9c99f31369ce..67589b607c4e 100644 --- a/drivers/media/dvb/frontends/drxk.h +++ b/drivers/media/dvb/frontends/drxk.h @@ -4,10 +4,25 @@ #include <linux/types.h> #include <linux/i2c.h> +/** + * struct drxk_config - Confi...
fec528b77f9be3e7ebb8d7c25888b0cf9fb8e8d6
Analyze and fix the following issue in the Linux kernel code: [media] Add initial support for Terratec H5
Problem Details: Not working yet. There are some fixes at the DRX-K that are needed for it to work. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/em28xx/Kconfig b/drivers/media/video/em28xx/Kconfig index 49878fd0c8f4..281ee427c2ab 100644 --- a/drivers/media/video/em28xx/Kconfig +++ b/drivers/media/video/em28xx/Kconfig @@ -39,6 +39,8 @@ config VIDEO_EM28XX_DVB select DVB_S921 if !DVB_FE_CUSTOMISE select DVB_DRXD if !DV...
2da6750117c8fc4772a9c980e14a8d5d67f504a4
Analyze and fix the following issue in the Linux kernel code: [media] drxk: Add debug printk's
Problem Details: This is a complex driver. Adding support for other devices with drxk requires to be able to debug it and see where it is failing. So, add optional printk messages to allow debugging it. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c index f550332d7f32..fe9445922942 100644 --- a/drivers/media/dvb/frontends/drxk_hard.c +++ b/drivers/media/dvb/frontends/drxk_hard.c @@ -173,6 +173,16 @@ bool IsA1WithRomCode(struct drxk_state *state) #define DRXK_QAM...
f3d40bd0991085f1f45e7c978a1603ec02468be3
Analyze and fix the following issue in the Linux kernel code: [media] tda18271c2dd: add tda18271c2dd prefix to the errors
Problem Details: It is hard to identify the origin for those errors without a prefix to indicate which driver produced them: [ 1390.220984] i2c_write error [ 1390.224133] I2C Write error [ 1391.284202] i2c_read error [ 1392.288685] i2c_read error Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/frontends/tda18271c2dd.c b/drivers/media/dvb/frontends/tda18271c2dd.c index 90584ebeb507..2eb3a31a715c 100644 --- a/drivers/media/dvb/frontends/tda18271c2dd.c +++ b/drivers/media/dvb/frontends/tda18271c2dd.c @@ -130,7 +130,7 @@ static int i2c_write(struct i2c_adapter *adap, u8 adr...
e0e6ecaf3b19686d561a3410aec67a0b2774455f
Analyze and fix the following issue in the Linux kernel code: [media] drxk: add drxk prefix to the errors
Problem Details: It is hard to identify the origin for those errors without a prefix to indicate which driver produced them: [ 1390.220984] i2c_write error [ 1390.224133] I2C Write error [ 1391.284202] i2c_read error [ 1392.288685] i2c_read error Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c index 24f9897077a0..f550332d7f32 100644 --- a/drivers/media/dvb/frontends/drxk_hard.c +++ b/drivers/media/dvb/frontends/drxk_hard.c @@ -317,7 +317,7 @@ static int i2c_write(struct i2c_adapter *adap, u8 adr, u8 *data, ...
7dfd071271bb237d16d8088287bf52a2684cb3ca
Analyze and fix the following issue in the Linux kernel code: [media] cxd2099: Fix compilation of ngene/ddbridge for DVB_CXD2099=n
Problem Details: Fix compilation of ngene/ddbridge for DVB_CXD2099=n. Note: Bug was introduced by commit 'cxd2099: Update to latest version'. Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/staging/cxd2099/cxd2099.h b/drivers/staging/cxd2099/cxd2099.h index 75459d41afc1..19c588a59588 100644 --- a/drivers/staging/cxd2099/cxd2099.h +++ b/drivers/staging/cxd2099/cxd2099.h @@ -41,7 +41,7 @@ struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg, #else static inline stru...
4f1f31078745b7af73e1a3a718004807cb1b7846
Analyze and fix the following issue in the Linux kernel code: [media] ddbridge: Codingstyle fixes
Problem Details: Codingstyle fixes Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/ddbridge/ddbridge-core.c b/drivers/media/dvb/ddbridge/ddbridge-core.c index ba9974bc154e..81634f137bb3 100644 --- a/drivers/media/dvb/ddbridge/ddbridge-core.c +++ b/drivers/media/dvb/ddbridge/ddbridge-core.c @@ -55,7 +55,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); static int ...
1bd09ddcffb2fb59d3211a9137d9122171724bae
Analyze and fix the following issue in the Linux kernel code: [media] drxk: fix warning: ‘status’ may be used uninitialized in this function
Problem Details: One of the problems of the old CHECK_ERROR is that it was hiding the status parameter. Maybe due to that, on a few places, the return code might lead to return incorrect status: drivers/media/dvb/frontends/drxk_hard.c: In function ‘load_microcode.clone.0’: drivers/media/dvb/frontends/drxk_hard.c:1281:...
```diff diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c index f7ae90081114..24f9897077a0 100644 --- a/drivers/media/dvb/frontends/drxk_hard.c +++ b/drivers/media/dvb/frontends/drxk_hard.c @@ -1278,7 +1278,7 @@ static int DownloadMicrocode(struct drxk_state *state, u16 Bl...
9daf9bccb3f82a61edfc62515297f1b2b876a591
Analyze and fix the following issue in the Linux kernel code: [media] cxd2099: Codingstyle fixes
Problem Details: Codingstyle fixes. Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/staging/cxd2099/cxd2099.c b/drivers/staging/cxd2099/cxd2099.c index 803a592b3507..6ec30c1fd4cb 100644 --- a/drivers/staging/cxd2099/cxd2099.c +++ b/drivers/staging/cxd2099/cxd2099.c @@ -64,7 +64,7 @@ static int i2c_write_reg(struct i2c_adapter *adapter, u8 adr, u8 reg, u8 data) { u8...
6c50b666a5d76b7f03961427a1e7d566e689caa3
Analyze and fix the following issue in the Linux kernel code: [media] ngene: Fix name of Digital Devices PCIe/miniPCIe
Problem Details: Fix name of Digital Devices PCIe/miniPCIe. Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/ngene/ngene-cards.c b/drivers/media/dvb/ngene/ngene-cards.c index 0d879cb2fb79..e6d5176d07cf 100644 --- a/drivers/media/dvb/ngene/ngene-cards.c +++ b/drivers/media/dvb/ngene/ngene-cards.c @@ -426,9 +426,9 @@ static struct ngene_info ngene_info_cineS2v5 = { }; -static struct n...
d9396b8410a43347933a0ee0ae8b2eb9492f4bc2
Analyze and fix the following issue in the Linux kernel code: [media] ngene: Fix return code if no demux was found
Problem Details: Fix return code if no demux was found (cineS2_probe). Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/ngene/ngene-cards.c b/drivers/media/dvb/ngene/ngene-cards.c index 0d550a950e53..0d879cb2fb79 100644 --- a/drivers/media/dvb/ngene/ngene-cards.c +++ b/drivers/media/dvb/ngene/ngene-cards.c @@ -274,6 +274,7 @@ static int cineS2_probe(struct ngene_channel *chan) demod_attach_drxk(...
9143a437cc2fe329c271115903a3884950aba57d
Analyze and fix the following issue in the Linux kernel code: [media] ngene: Codingstyle fixes
Problem Details: Codingstyle fixes Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/ngene/ngene-cards.c b/drivers/media/dvb/ngene/ngene-cards.c index ca2e146f1b8f..0d550a950e53 100644 --- a/drivers/media/dvb/ngene/ngene-cards.c +++ b/drivers/media/dvb/ngene/ngene-cards.c @@ -40,6 +40,7 @@ #include "lnbh24.h" #include "lgdt330x.h" #include "mt2131.h" +#include ...
ebee4b589ffeb8dd700c2a3649e31f4e41c1bb6b
Analyze and fix the following issue in the Linux kernel code: [media] v4l2-ctrls: Fix a merge conflict
Problem Details: Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c index b3ed33053584..06b6014d4fb4 100644 --- a/drivers/media/video/v4l2-ctrls.c +++ b/drivers/media/video/v4l2-ctrls.c @@ -339,8 +339,6 @@ const char * const *v4l2_ctrl_get_menu(u32 id) NULL, }; - switch (id) { - case V4L2_CI...
064f50966eb65e89c2434b57b2d2326dfee2b50c
Analyze and fix the following issue in the Linux kernel code: [media] v4l2-ctrl: add codec controls support to the control framework
Problem Details: Add support for the codec controls to the v4l2 control framework. [mchehab@redhat.com: Fix merge conflicts and removed some hunks that were adding blank lines without a good reason] Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-...
```diff diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c index 37c064829ea5..b3ed33053584 100644 --- a/drivers/media/video/v4l2-ctrls.c +++ b/drivers/media/video/v4l2-ctrls.c @@ -203,7 +203,7 @@ const char * const *v4l2_ctrl_get_menu(u32 id) }; static const char * const mpeg_stream_v...
aec67f054205da77f83ba52f83239225d6cbe366
Analyze and fix the following issue in the Linux kernel code: [media] DocBook: document V4L2_CTRL_TYPE_BITMASK
Problem Details: [mchehab@redhat.com: Fix a merge conflict and make compat.xml coherent with v4l2.xml] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/Documentation/DocBook/media/v4l/compat.xml b/Documentation/DocBook/media/v4l/compat.xml index b010ac6bfd2c..d7c015e8df81 100644 --- a/Documentation/DocBook/media/v4l/compat.xml +++ b/Documentation/DocBook/media/v4l/compat.xml @@ -2360,6 +2360,16 @@ that used it. It was originally scheduled for remo...
1de5be5e91ee10d8f42be2aebc1cede718b48d50
Analyze and fix the following issue in the Linux kernel code: [media] vivi: Fix sleep-in-atomic-context
Problem Details: Fix sleep-in-atomic-context bug in vivi: Jun 28 18:14:39 tschai kernel: [ 80.970478] BUG: sleeping function called from invalid context at kernel/mutex.c:271 Jun 28 18:14:39 tschai kernel: [ 80.970483] in_atomic(): 0, irqs_disabled(): 1, pid: 2854, name: vivi-000 Jun 28 18:14:39 tschai kernel: [ ...
```diff diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c index cc1cf6b17183..6e7bf5719b34 100644 --- a/drivers/media/video/vivi.c +++ b/drivers/media/video/vivi.c @@ -529,11 +529,13 @@ static void vivi_thread_tick(struct vivi_dev *dev) spin_lock_irqsave(&dev->slock, flags); if (list_empty(&dma_q...
ee490b466162925193c847b02aabd6048ff8cbe9
Analyze and fix the following issue in the Linux kernel code: [media] DocBook: fix typo: vl42_plane_pix_format -> v4l2_plane_pix_format
Problem Details: Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml index 804b2e5e0807..389432d780a7 100644 --- a/Documentation/DocBook/media/v4l/pixfmt.xml +++ b/Documentation/DocBook/media/v4l/pixfmt.xml @@ -121,7 +121,7 @@ set this field to zero.</entry> an array of <str...
1a4ede65f30315a31cb9b239bec0d4bb32834691
Analyze and fix the following issue in the Linux kernel code: [media] pwc: Fix non CodingStyle compliant 3 space indent in pwc.h
Problem Details: Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/pwc/pwc.h b/drivers/media/video/pwc/pwc.h index ae92fe211f6d..cfe82319f343 100644 --- a/drivers/media/video/pwc/pwc.h +++ b/drivers/media/video/pwc/pwc.h @@ -77,9 +77,9 @@ #define PWC_DEBUG_LEVEL (PWC_DEBUG_LEVEL_MODULE) #define PWC_DEBUG(level, fmt, args...) do {\ - if ((...
c246412117d871a3a90cd4e8ba2c6dea18a59f71
Analyze and fix the following issue in the Linux kernel code: [media] pwc: Remove a bunch of bogus sanity checks / don't return EFAULT wrongly
Problem Details: The chances if any of these becoming NULL magically are 0% And if they do become NULL oopsing is the right thing to do (so that the user logs a bug with the kernel rather then with whatever app he was using). Returning EFAULT to userspace should only be done when userspace supplies a bad address, not ...
```diff diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c index b0bde5a87c8a..3d3ff6030987 100644 --- a/drivers/media/video/pwc/pwc-if.c +++ b/drivers/media/video/pwc/pwc-if.c @@ -226,9 +226,6 @@ static int pwc_allocate_buffers(struct pwc_device *pdev) PWC_DEBUG_MEMORY(">> pwc_allocat...
2f2ea0f3f25effeaf0d27f5aaad591281fad27e2
Analyze and fix the following issue in the Linux kernel code: [media] gspca_sunplus: Fix streaming on logitech quicksmart 420
Problem Details: Don't issue a stream stop to the camera at the end of sd_start, this fixes streaming with this particular model. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/gspca/sunplus.c b/drivers/media/video/gspca/sunplus.c index b089c0d3ee9f..6ec232902183 100644 --- a/drivers/media/video/gspca/sunplus.c +++ b/drivers/media/video/gspca/sunplus.c @@ -247,7 +247,6 @@ static const struct cmd spca504A_clicksmart420_init_data[] = { {0x30, 0x0004, 0...
0fdee88e54f0b8bd737810517ba70bde5fd7a70c
Analyze and fix the following issue in the Linux kernel code: [media] gspca - ov519: Fix a LED inversion
Problem Details: In the webcam 041e:405f, the LED is inverted. Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c index b17c6604eb41..0800433b2092 100644 --- a/drivers/media/video/gspca/ov519.c +++ b/drivers/media/video/gspca/ov519.c @@ -5006,7 +5006,8 @@ static const struct sd_desc sd_desc = { static const struct usb_device_id device_table...
b877a9a7fb00d96bae4ab49c69f1be65b3e87e61
Analyze and fix the following issue in the Linux kernel code: [media] gspca - ov519: Fix sensor detection problems
Problem Details: The sensor of some webcams could not be detected due to timing problems in sensor register reading. This patch adds bridge register readings before sensor register reading. Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c index cb42a5182d17..b17c6604eb41 100644 --- a/drivers/media/video/gspca/ov519.c +++ b/drivers/media/video/gspca/ov519.c @@ -2432,9 +2432,12 @@ static int ov518_i2c_r(struct sd *sd, u8 reg) /* Initiate 2-byte write cycle */ ...
5fec8b900237ecc8ba1bbc3d051a655d43b6881c
Analyze and fix the following issue in the Linux kernel code: [media] V4L: ov9740: Correct print in ov9740_reg_rmw()
Problem Details: The register width of the ov9740 is 16-bits, so correct the debug print to reflect this. Signed-off-by: Andrew Chew <achew@nvidia.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/ov9740.c b/drivers/media/video/ov9740.c index 96811e42993d..d5c906147e78 100644 --- a/drivers/media/video/ov9740.c +++ b/drivers/media/video/ov9740.c @@ -537,7 +537,8 @@ static int ov9740_reg_rmw(struct i2c_client *client, u16 reg, u8 set, u8 unset) ret = ov9740_reg_read(clien...
ddac5c107942d9584a9f55701aad405b57618726
Analyze and fix the following issue in the Linux kernel code: [media] v4l2-ctrls: fix and improve volatile control handling
Problem Details: If you have a cluster of controls that is a mix of volatile and non-volatile controls, then requesting the value of the volatile control would fail if the master control of that cluster was non-volatile. The code assumed that the volatile state of the master control was the same for all other controls ...
```diff diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c index 459f7272d326..46cacf845049 100644 --- a/drivers/media/radio/radio-wl1273.c +++ b/drivers/media/radio/radio-wl1273.c @@ -1382,7 +1382,7 @@ static int wl1273_fm_g_volatile_ctrl(struct v4l2_ctrl *ctrl) switch (ctrl->id) ...
fd3e5824824d1beaf376cd523c7418c5570851d4
Analyze and fix the following issue in the Linux kernel code: [media] uvcvideo: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
Problem Details: uvcvideo doesn't use vidioc_ioctl2. As the API is changing to use a common version for all drivers, we need to expliticly fix this driver. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c index b6eae48d7fb8..749c72222665 100644 --- a/drivers/media/video/uvc/uvc_driver.c +++ b/drivers/media/video/uvc/uvc_driver.c @@ -31,6 +31,7 @@ #include <linux/videodev2.h> #include <linux/vmalloc.h> #include <linux/wait...
6c13b45e57c3b719328e1ead30b07583419ad9a1
Analyze and fix the following issue in the Linux kernel code: [media] sn9c102: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
Problem Details: sn9c102 doesn't use vidioc_ioctl2. As the API is changing to use a common version for all drivers, we need to expliticly fix this driver. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/sn9c102/sn9c102.h b/drivers/media/video/sn9c102/sn9c102.h index cbfc44433b99..22ea211ab54f 100644 --- a/drivers/media/video/sn9c102/sn9c102.h +++ b/drivers/media/video/sn9c102/sn9c102.h @@ -21,7 +21,6 @@ #ifndef _SN9C102_H_ #define _SN9C102_H_ -#include <linux/version.h> #i...
083774d8b164b87c5595ead0b752236cfd5bf761
Analyze and fix the following issue in the Linux kernel code: [media] pvrusb2: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
Problem Details: pvrusb2 doesn't use vidioc_ioctl2. As the API is changing to use a common version for all drivers, we need to expliticly fix this driver. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/pvrusb2/pvrusb2-main.c b/drivers/media/video/pvrusb2/pvrusb2-main.c index 2254194aad57..c1d9bb61cd77 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-main.c +++ b/drivers/media/video/pvrusb2/pvrusb2-main.c @@ -168,6 +168,7 @@ module_exit(pvr_exit); MODULE_AUTHOR(DRIVER_AUTHOR);...
5204cebadd09c5bd7e4fc194b9dfaba9e40c0361
Analyze and fix the following issue in the Linux kernel code: [media] et61x251: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
Problem Details: et61x251 doesn't use vidioc_ioctl2. As the API is changing to use a common version for all drivers, we need to expliticly fix this driver. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/et61x251/et61x251.h b/drivers/media/video/et61x251/et61x251.h index bf66189cb26d..14bb907d650e 100644 --- a/drivers/media/video/et61x251/et61x251.h +++ b/drivers/media/video/et61x251/et61x251.h @@ -21,7 +21,6 @@ #ifndef _ET61X251_H_ #define _ET61X251_H_ -#include <linux/vers...
ae6db5154671759426046c2cbc2e20a82ff0feed
Analyze and fix the following issue in the Linux kernel code: [media] v4l2-ioctl: Add a default value for kernel version
Problem Details: Most drivers don't increase kernel versions as newer features are added or bug fixes are solved. So, vidioc_querycap returned value for cap->version is meaningless. Instead of keeping this situation forever, let's add a default value matching the current Linux version. Drivers that want to keep their ...
```diff diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index 55df1436f835..48b94fcb6a25 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c @@ -16,6 +16,7 @@ #include <linux/slab.h> #include <linux/types.h> #include <linux/kernel.h> +#include <linux/...
3751e32961f22e256de85ebd585597ce5875037a
Analyze and fix the following issue in the Linux kernel code: [media] v4l: Fix minor typos in the documentation
Problem Details: Signed-off-by: Sylwester Nawrocki <snjw23@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/Documentation/DocBook/media/v4l/media-ioc-enum-links.xml b/Documentation/DocBook/media/v4l/media-ioc-enum-links.xml index d2fc73ef8d56..355df43badc5 100644 --- a/Documentation/DocBook/media/v4l/media-ioc-enum-links.xml +++ b/Documentation/DocBook/media/v4l/media-ioc-enum-links.xml @@ -139,7 +139,7 ...
b7a80f341da5d40a4d483f8c9246133c8591de87
Analyze and fix the following issue in the Linux kernel code: [media] tea575x: remove useless input ioctls
Problem Details: Remove empty and useless g_input and s_input ioctls. This fixes one fail of v4l2-compliance test. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c index beb0e86537cd..484a35b3715f 100644 --- a/sound/i2c/other/tea575x-tuner.c +++ b/sound/i2c/other/tea575x-tuner.c @@ -269,19 +269,6 @@ static int tea575x_s_ctrl(struct v4l2_ctrl *ctrl) return -EINVAL; } -static int vidioc_g_in...
dff0f8c279e34089128e9687d77bfc72dbb471bd
Analyze and fix the following issue in the Linux kernel code: [media] em28xx-audio: Some Alsa API fixes
Problem Details: Mark the alsa stream with SNDRV_PCM_INFO_BATCH, as the timing to get audio streams can vary. Also, add SNDRV_PCM_TRIGGER for pause/release. while here, fix the stop indicator, to be sure that audio will be properly released at the stop events. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com...
```diff diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index 5381f6d7427d..47f21a382546 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c @@ -249,6 +249,7 @@ static struct snd_pcm_hardware snd_em28xx_hw_capture = { ...
66cb6957d338383157d4fdafef7c85e488e9e535
Analyze and fix the following issue in the Linux kernel code: [media] em28xx-audio: add debug info for the volume control
Problem Details: Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index 302553a7f83f..56739a462169 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c @@ -464,6 +464,13 @@ static int em28xx_vol_put(struct snd_kcontrol *kcontrol,...
71d7d83edc5129509a2cba1cf9848579cf9619e5
Analyze and fix the following issue in the Linux kernel code: [media] em28xx-audio: volumes are inverted
Problem Details: While here, fix volume mask to 5 bits Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index c7b96b46d346..302553a7f83f 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c @@ -452,8 +452,8 @@ static int em28xx_vol_put(struct snd_kcontrol *kcontrol, ...
0f8a61fc42a618e25c61549590c35c66c63e2ca7
Analyze and fix the following issue in the Linux kernel code: [media] em28xx: Fix a wrong enum at the ac97 control tables
Problem Details: Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c index 55d0d9d1019f..7bf3a86902b0 100644 --- a/drivers/media/video/em28xx/em28xx-core.c +++ b/drivers/media/video/em28xx/em28xx-core.c @@ -314,12 +314,12 @@ int em28xx_write_ac97(struct em28xx *dev, u8 reg, u16 val) ...
00d2e7ad9dd4e88224d091e454371d8a9a80719f
Analyze and fix the following issue in the Linux kernel code: [media] em28xx: Don't initialize a var if won't be using it
Problem Details: Fixes most cases of initializing a var but not using it. There are still 3 cases at em28xx-alsa, were those vars should probably be used. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index 3c48a72eb7de..a24e1770db48 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c @@ -286,10 +286,9 @@ static int snd_em28xx_capture_open(struct snd_pcm_substr...
2c87d9db46d1dcc956facaf98805d4d68b823b23
Analyze and fix the following issue in the Linux kernel code: [media] drivers/media/video: fix memory leak of snd_cx18_init()
Problem Details: cxsc is not freed in the error case. Signed-off-by: Andre Bartke <andre.bartke@gmail.com> Cc: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/cx18/cx18-alsa-main.c b/drivers/media/video/cx18/cx18-alsa-main.c index d50d69da387b..a1e6c2a32478 100644 --- a/drivers/media/video/cx18/cx18-alsa-main.c +++ b/drivers/media/video/cx18/cx18-alsa-main.c @@ -192,6 +192,7 @@ static int snd_cx18_init(struct v4l2_device *v4l2_dev) e...
dc05e571725a5a609a29bd84bd020263728ed5e4
Analyze and fix the following issue in the Linux kernel code: [media] DocBook/video.xml: Fix section references with video.h.xml
Problem Details: Make the reference links at video.h.xml to match the ones at video.xml. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/Documentation/DocBook/media/Makefile b/Documentation/DocBook/media/Makefile index a914eb094cd9..1e909c28299e 100644 --- a/Documentation/DocBook/media/Makefile +++ b/Documentation/DocBook/media/Makefile @@ -146,7 +146,7 @@ DVB_DOCUMENTED = \ -e "s,\(define\s\+\)\(DTV_[A-Z0-9_]\+\)\(\s\+[0-9]\+\),\...
fb029093e7408efa177e80444199746638c7d79d
Analyze and fix the following issue in the Linux kernel code: [media] DocBook/demux.xml: Fix section references with dmx.h.xml
Problem Details: Make the reference links at dmx.h.xml to match the ones at demux.xml. While here, also syncronizes the structures defined inside the API, in order to match the current API. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/Documentation/DocBook/media/Makefile b/Documentation/DocBook/media/Makefile index 249edd353968..0b055ad411c8 100644 --- a/Documentation/DocBook/media/Makefile +++ b/Documentation/DocBook/media/Makefile @@ -150,7 +150,7 @@ DVB_DOCUMENTED = \ -e "s,\(define\s\+\)\(DTV_[A-Z0-9_]\+\)\(\s\+[0-9]\+\),\...
4cde378b3b7cfc65000deab14bfc1b314cb4075b
Analyze and fix the following issue in the Linux kernel code: [media] DocBook/audio.xml: match section ID's with the reference links
Problem Details: Make sure that both audio.h.xml and audio.xml will match the same names. This way, it is now possible to identify API spec gaps: Error: no ID for constraint linkend: AUDIO_CONTINUE. Error: no ID for constraint linkend: AUDIO_GET_PTS. Error: no ID for constraint linkend: AUDIO_BILINGUAL_CHANNEL_SELECT....
```diff diff --git a/Documentation/DocBook/media/Makefile b/Documentation/DocBook/media/Makefile index a747f2a6c2c1..18604dde1b87 100644 --- a/Documentation/DocBook/media/Makefile +++ b/Documentation/DocBook/media/Makefile @@ -150,6 +150,7 @@ DVB_DOCUMENTED = \ -e "s,\(define\s\+\)\(DTV_[A-Z0-9_]\+\)\(\s\+[0-9]\+\),\...
941830c9278a72e31389eb04cdfc397f66866de0
Analyze and fix the following issue in the Linux kernel code: [media] xc4000: make checkpatch.pl happy
Problem Details: Solve the ./scripts/checkpatch.pl compliants for the patches that added xc4000 support, including a few changes at dib0700. While here, remove a few printk noise by converting some msgs into debug ones. Cc: Istvan Varga <istvan_v@mailbox.hu> Cc: Patrick Boettcher <pboettcher@kernellabs.com> Signed-of...
```diff diff --git a/drivers/media/common/tuners/xc4000.c b/drivers/media/common/tuners/xc4000.c index 479c198e9469..634f4d9b6c63 100644 --- a/drivers/media/common/tuners/xc4000.c +++ b/drivers/media/common/tuners/xc4000.c @@ -244,8 +244,8 @@ static struct XC_TV_STANDARD xc4000_standard[MAX_TV_STANDARD] = { {"DTV8", ...
f4312e2fd4ca44e1defad1637d054bbe11a4ade6
Analyze and fix the following issue in the Linux kernel code: [media] xc4000: debug message improvements
Problem Details: The following patch makes a few minor changes to the printing of debug messages, and reporting the tuner status. The 'debug' module parameter can now be set from 0 to 2 to control the verbosity of debug messages. Signed-off-by: Istvan Varga <istvan_v@mailbox.hu> Signed-off-by: Mauro Carvalho Chehab <m...
```diff diff --git a/drivers/media/common/tuners/xc4000.c b/drivers/media/common/tuners/xc4000.c index ec5f1f1b3f3c..24afebb93331 100644 --- a/drivers/media/common/tuners/xc4000.c +++ b/drivers/media/common/tuners/xc4000.c @@ -39,7 +39,7 @@ static int debug; module_param(debug, int, 0644); -MODULE_PARM_DESC(debug, ...
027fd361860e40736c0ad093a8f4194d727afb63
Analyze and fix the following issue in the Linux kernel code: [media] xc4000: firmware initialization
Problem Details: This patch fixes/cleans up the loading of the firmware file when the driver is loaded and initialized. Signed-off-by: Istvan Varga <istvan_v@mailbox.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/common/tuners/xc4000.c b/drivers/media/common/tuners/xc4000.c index c373f4b36f5a..ec5f1f1b3f3c 100644 --- a/drivers/media/common/tuners/xc4000.c +++ b/drivers/media/common/tuners/xc4000.c @@ -1400,21 +1400,8 @@ static int xc4000_sleep(struct dvb_frontend *fe) static int xc4000_init...
595a83f49a7536f43a68cab78098d5ad11d1c51f
Analyze and fix the following issue in the Linux kernel code: [media] xc4000: check_firmware() cleanup
Problem Details: This patch makes the following fixes in check_firmware(): - there is only one BASE and INIT1 firmware for XC4000 - loading SCODE is needed also for FM radio Signed-off-by: Istvan Varga <istvan_v@mailbox.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/common/tuners/xc4000.c b/drivers/media/common/tuners/xc4000.c index d83da50ebb70..71739dc33438 100644 --- a/drivers/media/common/tuners/xc4000.c +++ b/drivers/media/common/tuners/xc4000.c @@ -903,7 +903,7 @@ static int check_firmware(struct dvb_frontend *fe, unsigned int type, struc...
1368ceb266990af58a72cdb0e121eb4ff22bde6f
Analyze and fix the following issue in the Linux kernel code: [media] xc4000: fixed frequency error
Problem Details: The xc_get_frequency_error() function reported the frequency error incorrectly. The data read from the hardware is a signed integer, in 15625 Hz units. The attached patch fixes the bug. Signed-off-by: Istvan Varga <istvan_v@mailbox.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/common/tuners/xc4000.c b/drivers/media/common/tuners/xc4000.c index be43a6dfac6c..f50dd6e713f7 100644 --- a/drivers/media/common/tuners/xc4000.c +++ b/drivers/media/common/tuners/xc4000.c @@ -417,8 +417,9 @@ static int xc_get_frequency_error(struct xc4000_priv *priv, u32 *freq_error_h...
e3bb7c607f5ca87030692ad4dab653b4a8d1571a
Analyze and fix the following issue in the Linux kernel code: [media] xc4000: Fix a few bad whitespaces on it
Problem Details: Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/common/tuners/xc4000.c b/drivers/media/common/tuners/xc4000.c index bad9c9db9f0f..19be5aa21107 100644 --- a/drivers/media/common/tuners/xc4000.c +++ b/drivers/media/common/tuners/xc4000.c @@ -73,7 +73,7 @@ struct firmware_properties { v4l2_std_id std_req; __u16 int_freq; unsign...
b6cdb5bea31c86645782950d84745bb2f95ec9ca
Analyze and fix the following issue in the Linux kernel code: [media] xc4000: cleanup dmesg logging
Problem Details: Remove some printk() calls added during driver development, and demote some other messages to debug only (to reduce dmesg chatter). Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/common/tuners/xc4000.c b/drivers/media/common/tuners/xc4000.c index 02edd9493d27..bad9c9db9f0f 100644 --- a/drivers/media/common/tuners/xc4000.c +++ b/drivers/media/common/tuners/xc4000.c @@ -639,12 +639,6 @@ static int seek_firmware(struct dvb_frontend *fe, unsigned int type, int ...
4922cec59a1b37d49b3e01577ab2f779a13b3ae6
Analyze and fix the following issue in the Linux kernel code: [media] xc4000: turn off debug logging by default
Problem Details: Don't dump debug into to dmesg by default (something I had enabled during bringup of the xc4000 driver). Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/common/tuners/xc4000.c b/drivers/media/common/tuners/xc4000.c index 1263bfe12bc2..49d5929389ff 100644 --- a/drivers/media/common/tuners/xc4000.c +++ b/drivers/media/common/tuners/xc4000.c @@ -36,7 +36,7 @@ #include "tuner-i2c.h" #include "tuner-xc2028-types.h" -static int debug=1;...
32127363eebdf63be2f375ed94838a4cdb1d6fe0
Analyze and fix the following issue in the Linux kernel code: [media] mt9v011: Fixed gain calculation
Problem Details: The implementation of the gain calculation for this sensor is incorrect. It is only working for the first 127 values. The reason is, that the gain cannot be set directly by writing a value into the gain registers of the sensor. The gain register work this way (see datasheet page 24): bits 0 to 6 are c...
```diff diff --git a/drivers/media/video/mt9v011.c b/drivers/media/video/mt9v011.c index fbbd018c94ab..893a8b8f5141 100644 --- a/drivers/media/video/mt9v011.c +++ b/drivers/media/video/mt9v011.c @@ -54,7 +54,7 @@ static struct v4l2_queryctrl mt9v011_qctrl[] = { .type = V4L2_CTRL_TYPE_INTEGER, .name = "Gain", ....
b87f2eddfaa2e74b51978f7c8671f3f4777af3fe
Analyze and fix the following issue in the Linux kernel code: [media] rc-core: fix winbond-cir issues
Problem Details: The conversion of winbond-cir to use rc-core seems to have missed a a few bits and pieces which were in my local tree. Kudos to Juan Jesús García de Soria Lucena <skandalfo@gmail.com> for noticing. [mchehab@redhat.com: fix two UTF-8 violations] Signed-off-by: David Härdeman <david@hardeman.nu> Signed-...
```diff diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index 5d06b899e859..18e70d104f80 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c @@ -6,8 +6,8 @@ * could probably support others (Winbond WEC102X, NatSemi, etc) * with minor modifications. * - *...
7eb75715460026c82afd20e42ee51f4b30fe4bae
Analyze and fix the following issue in the Linux kernel code: [media] rc/redrat3: dereferencing null pointer
Problem Details: In the original code, if the allocation failed we dereference "rr3" when it was NULL. Acked-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c index 5147767ccb78..4582ef72d963 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c @@ -1186,7 +1186,7 @@ static int __devinit redrat3_dev_probe(struct usb_interface *intf, rr3 = kzalloc(sizeof(*rr3), GFP_KERNEL); if ...
ec05a642140c7c34f7ba1cb8a94be9b1154286ae
Analyze and fix the following issue in the Linux kernel code: [media] DVB: dvb_frontend: fix dtv_property_dump for DTV_DVBT2_PLP_ID
Problem Details: - Add missing entry to array "dtv_cmds". - Set array size to DTV_MAX_COMMAND + 1 to avoid future off-by-ones. Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Andreas Oberritter <obi@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 5b6b451d4694..efe9c30605e8 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -904,7 +904,7 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *...
7f116b3ea908e277132fd68c5ff4c46284ae2d97
Analyze and fix the following issue in the Linux kernel code: [media] V4L/videobuf2-memops: use pr_debug for debug messages
Problem Details: Otherwise they clutter the dmesg buffer even on a production kernel. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/videobuf2-memops.c b/drivers/media/video/videobuf2-memops.c index 5370a3a7ee25..1987e1b13b95 100644 --- a/drivers/media/video/videobuf2-memops.c +++ b/drivers/media/video/videobuf2-memops.c @@ -177,7 +177,7 @@ int vb2_mmap_pfn_range(struct vm_area_struct *vma, unsigned long padd...
f54ba7f199d63cea08b8cc7114cb6c5cd9a042ab
Analyze and fix the following issue in the Linux kernel code: [media] radio-si470x: fix memory leak in si470x_usb_driver_probe()
Problem Details: radio->int_in_urb is not deallocated on error paths in si470x_usb_driver_probe(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c index 392e84fe90ef..ccefdaea4dc5 100644 --- a/drivers/media/radio/si470x/radio-si470x-usb.c +++ b/drivers/media/radio/si470x/radio-si470x-usb.c @@ -699,7 +699,7 @@ static int si470x_usb_driver_probe(struct...
2ef403708880c6e00854fb81bbffb9a4036327e6
Analyze and fix the following issue in the Linux kernel code: [media] Fix compile warning: Dereferencing type-punned pointer will break strict-aliasing rules
Problem Details: Signed-off-by: Hans Petter Selasky <hselasky@c2i.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index 69e8c6ffcc49..55df1436f835 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c @@ -2276,7 +2276,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size, break; ...
58b0ed25b6e9d6dbf00c30b816e8a2a0fec2bec8
Analyze and fix the following issue in the Linux kernel code: [media] Update several cardlists
Problem Details: Several cardlist entries are missed. Fix them by running some script magic (about the same scripts we used to have at -hg tree). Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885 index 87c46347bd63..8910449d23a8 100644 --- a/Documentation/video4linux/CARDLIST.cx23885 +++ b/Documentation/video4linux/CARDLIST.cx23885 @@ -27,3 +27,5 @@ 26 -> Hauppauge WinTV-HVR1290 ...
ebaefdb7651383645f17d2d32398914175d1bcdd
Analyze and fix the following issue in the Linux kernel code: [media] em28xx: use the proper prefix for board names
Problem Details: All boards use EM28xxx_BOARD, to identify that the macro refers to a card entry. So: EM2874_LEADERSHIP_ISDBT -> EM2874_BOARD_LEADERSHIP_ISDBT Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index f15c73469ee7..7635a45a1220 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c @@ -1259,7 +1259,7 @@ struct em28xx_board em28xx_boards[] = { } }, }, ...
1d44ccb9ea7fc05cae7d76fdb7e1e54c7dd27ef5
Analyze and fix the following issue in the Linux kernel code: [media] cxd2820r: fix bitfields
Problem Details: error: dubious one-bit signed bitfield Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/frontends/cxd2820r.h b/drivers/media/dvb/frontends/cxd2820r.h index ad17845123d9..2906582dc94c 100644 --- a/drivers/media/dvb/frontends/cxd2820r.h +++ b/drivers/media/dvb/frontends/cxd2820r.h @@ -55,13 +55,13 @@ struct cxd2820r_config { * Default: 0 * Values: 0, 1 */ - in...
aadcec010127a20599500c7007fbe9998744be41
Analyze and fix the following issue in the Linux kernel code: iscsi-target: Fix CONFIG_SMP=n and CONFIG_MODULES=n build failure
Problem Details: This patch fixes the following CONFIG_SMP=n and CONFIG_MODULES=n build failure, because iscsit_thread_get_cpumask() is defined as a macro in iscsi_target.c, but needed by iscsi_target_login.c drivers/built-in.o: In function `iscsi_post_login_handler': iscsi_target_login.c:(.text+0x13a315): undefined r...
```diff diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 3ab8abca29c3..c24fb10de60b 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -3468,7 +3468,12 @@ static inline void iscsit_thread_check_cpumask( } #else -#define iscsit_th...
7bbb654e9c77a8692425dbd2c704ad245b86ec8a
Analyze and fix the following issue in the Linux kernel code: iscsi-target: Fix snprintf usage with MAX_PORTAL_LEN
Problem Details: This patch makes lio_target_call_addnptotpg() use sprintf() with MAX_PORTAL_LEN + 1 to address the following smatch warning: drivers/target/iscsi/iscsi_target_configfs.c +184 lio_target_call_addnptotpg(21) error: snprintf() chops off the last chars of 'name': 257 vs 256 Reported-by: Dan Carpe...
```diff diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index 32bb92c44450..f095e65b1ccf 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c @@ -181,7 +181,7 @@ struct se_tpg_np *lio_target_call_addnptotpg(...
76f1928e8831961a692459924cfac0ca1b0d303a
Analyze and fix the following issue in the Linux kernel code: iscsi-target: Fix uninitialized usage of cmd->pad_bytes
Problem Details: This patch fixes an uninitialized usage of cmd->pad_bytes inside of iscsit_handle_text_cmd() introduced during a v4.1 change to use cmd members instead of local pad_bytes variables. Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
```diff diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 396c79d8569c..3ab8abca29c3 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -1857,7 +1857,7 @@ static int iscsit_handle_text_cmd( char *text_ptr, *text_in; int cmdsn_ret,...
8f50c7f5d63b0e4a29f6f96e8cfaca782e0c458d
Analyze and fix the following issue in the Linux kernel code: iscsi-target: strlen() doesn't count the terminator
Problem Details: This patch fixes an off by one check in iscsit_add_tiqn() because the NULL terminator isn't taken into consideration. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
```diff diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 14c81c4265bd..396c79d8569c 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -120,7 +120,7 @@ struct iscsi_tiqn *iscsit_add_tiqn(unsigned char *buf) struct iscsi_tiqn *tiqn ...
4a28a3fa8c37193b105807193b3695048f0050a4
Analyze and fix the following issue in the Linux kernel code: iscsi-target: Fix NULL dereference on allocation failure
Problem Details: This patch fixes a bug in iscsi_target_init_negotiation() where the "goto out" path dereferences "login" which is NULL upon a memory allocation failure. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
```diff diff --git a/drivers/target/iscsi/iscsi_target_nego.c b/drivers/target/iscsi/iscsi_target_nego.c index 713a4d23557a..4d087ac11067 100644 --- a/drivers/target/iscsi/iscsi_target_nego.c +++ b/drivers/target/iscsi/iscsi_target_nego.c @@ -978,7 +978,7 @@ struct iscsi_login *iscsi_target_init_negotiation( pr_err(...
2cf8572dac62cc2ff7e995173e95b6c694401b3f
Analyze and fix the following issue in the Linux kernel code: Btrfs: use the commit_root for reading free_space_inode crcs
Problem Details: Now that we are using regular file crcs for the free space cache, we can deadlock if we try to read the free_space_inode while we are updating the crc tree. This commit fixes things by using the commit_root to read the crcs. This is safe because we the free space cache file would already be loaded if...
```diff diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 03dce3f40ce0..502b9e988679 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -187,4 +187,13 @@ static inline void btrfs_i_size_write(struct inode *inode, u64 size) BTRFS_I(inode)->disk_i_size = size; } +static inline bool ...
81317fdeddcef259b6ecf7b5c0d04caa167c6b54
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix deadlock when throttling transactions
Problem Details: Hit this nice little deadlock. What happens is this __btrfs_end_transaction with throttle set, --use_count so it equals 0 btrfs_commit_transaction <somebody else actually manages to start the commit> btrfs_end_transaction --use_count so now its -1 <== BAD we just return and wait on th...
```diff diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 654755b18951..eb55863bb4ae 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -497,10 +497,17 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans, } if (lock && cur_trans->blocked && !cur_trans->in_commi...
199c36eaa95077a47ae1bc55532fc0fbeb80cc95
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix BUG_ON() caused by ENOSPC when relocating space
Problem Details: When we balanced the chunks across the devices, BUG_ON() in __finish_chunk_alloc() was triggered. ------------[ cut here ]------------ kernel BUG at fs/btrfs/volumes.c:2568! [SNIP] Call Trace: [<ffffffffa049525e>] btrfs_alloc_chunk+0x8e/0xa0 [btrfs] [<ffffffffa04546b0>] do_chunk_alloc+0x330/0x3a0 [b...
```diff diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index d7031e7dfd76..7021dde74d81 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -6526,15 +6526,28 @@ static u64 update_block_group_flags(struct btrfs_root *root, u64 flags) return flags; } -static int set_block_group_ro(struc...
9e0baf60dea69f31ac3b1adeb35b03b02a53e8e1
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix enospc problems with delalloc
Problem Details: So I had this brilliant idea to use atomic counters for outstanding and reserved extents, but this turned out to be a bad idea. Consider this where we have 1 outstanding extent and 1 reserved extent Reserver Releaser atomic_dec(outstanding) now 0 atomic_read(outstanding)+1 get 1 atomic_read(r...
```diff diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 52d7eca8c7bf..03dce3f40ce0 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -34,6 +34,9 @@ struct btrfs_inode { */ struct btrfs_key location; + /* Lock for counters */ + spinlock_t lock; + /* the extent_tree has cache...
a94733d0bc630edaedc6ca156752dd5a7cb82521
Analyze and fix the following issue in the Linux kernel code: Btrfs: use find_or_create_page instead of grab_cache_page
Problem Details: grab_cache_page will use mapping_gfp_mask(), which for all inodes is set to GFP_HIGHUSER_MOVABLE. So instead use find_or_create_page in all cases where we need GFP_NOFS so we don't deadlock. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
```diff diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index fa4ef18b66b1..bd6bbb877ff2 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1081,7 +1081,8 @@ static noinline int prepare_pages(struct btrfs_root *root, struct file *file, again: for (i = 0; i < num_pages; i++) { - pages[i] = grab_cache_page(inode...
bab39bf998133510f2dad08158006197ec0dabea
Analyze and fix the following issue in the Linux kernel code: Btrfs: use a worker thread to do caching
Problem Details: A user reported a deadlock when copying a bunch of files. This is because they were low on memory and kthreadd got hung up trying to migrate pages for an allocation when starting the caching kthread. The page was locked by the person starting the caching kthread. To fix this we just need to use the ...
```diff diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 406c33876605..9f6f342900c9 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -767,7 +767,6 @@ struct btrfs_space_info { struct list_head block_groups[BTRFS_NR_RAID_TYPES]; spinlock_t lock; struct rw_semaphore groups_sem; - atomic_t caching_threa...
8aae36cdf12313cd9cc0e4799fe1ea64d3c623f3
Analyze and fix the following issue in the Linux kernel code: staging: brcm80211: Fix double include introduced by bad merge
Problem Details: A merge with Linus' tree added a double include of linux/interrupt.h. Fix by removing one of the includes. Signed-off-by: Daniel Morsing <daniel.morsing@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.h b/drivers/staging/brcm80211/brcmsmac/mac80211_if.h index 5711e7c16b50..40e3d375ea99 100644 --- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.h +++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.h @@ -24,8 +24,6 @@ #define BRCMS_SET_SHORTSLOT_OV...
885f24e152d2b85569d33a1679cf47db56172b9c
Analyze and fix the following issue in the Linux kernel code: ARM: tegra: only select MACH_HAS_SND_SOC_TEGRA_WM8903 if SND_SOC
Problem Details: This fixes: warning: (MACH_HARMONY && MACH_KAEN && MACH_SEABOARD) selects MACH_HAS_SND_SOC_TEGRA_WM8903 which has unmet direct dependencies (SOUND && !M68K && SND && SND_SOC) Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Stephen Warren <swarren@nvidia.com> Acked-By: Colin...
```diff diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index 5ec1846aa1d0..fec64f3aa68e 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -27,14 +27,14 @@ comment "Tegra board type" config MACH_HARMONY bool "Harmony board" - select MACH_HAS_SND_SOC_TE...
c48a8fb0d31d6147d8d76b8e2ad7f51a2fbb5c4d
Analyze and fix the following issue in the Linux kernel code: ALSA: hda - Fix duplicated DAC assignments for Realtek
Problem Details: Copying hp_pins and speaker_pins from line_out_pins may confuse the parser, and it can lead to duplicated initializations for the same pin with a wrong DAC assignment. The problem appears in 3.0 kernel code. Cc: <stable@kernel.org> (for 3.0) Signed-off-by: Takashi Iwai <tiwai@suse.de>
```diff diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 0383dd8a11df..e125c60fe352 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -895,13 +895,15 @@ static void alc_init_auto_hp(struct hda_codec *codec) if (present == 3) spec->automute_hp_lo = 1; ...
ae6ff61e43fe4f348a7f764ff0c13fb4240da7b8
Analyze and fix the following issue in the Linux kernel code: ALSA: asihpi - off by one in asihpi_hpi_ioctl()
Problem Details: "adapter" is used as an array index in the adapters[] array so the off by one would make us read past the end. 1c073b67979 "ALSA: asihpi - Remove spurious adapter index check" reverted Dan Rosenberg's check that would have prevented the overflow here. Signed-off-by: Dan Carpenter <error27@gmail.com> ...
```diff diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c index e0cff0c72e51..9683f84ecdc8 100644 --- a/sound/pci/asihpi/hpioctl.c +++ b/sound/pci/asihpi/hpioctl.c @@ -183,7 +183,7 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg) u32 adapter = hm->h.adapter_index; ...
60a6a8425a84fa46a3831ce79197640b8224311b
Analyze and fix the following issue in the Linux kernel code: ALSA: hda - Fix Oops with Realtek quirks with NULL adc_nids
Problem Details: Somce quirk models don't set adc_nids but let the parser filling it. But the recent code has unnecessary NULL-checks of spec->input_mux, and it resulted in NULL dereferences. This patch fixes that regression. Reported-and-tested-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Takashi Iwai <tiwai@su...
```diff diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 694327ae8b71..0383dd8a11df 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -1911,7 +1911,7 @@ static int alc_build_controls(struct hda_codec *codec) return err; } } - if (spec->cap_mixer)...
b5b515445f4f5a905c5dd27e6e682868ccd6c09d
Analyze and fix the following issue in the Linux kernel code: [SCSI] pmcraid: reject negative request size
Problem Details: There's a code path in pmcraid that can be reached via device ioctl that causes all sorts of ugliness, including heap corruption or triggering the OOM killer due to consecutive allocation of large numbers of pages. First, the user can call pmcraid_chr_ioctl(), with a type PMCRAID_PASSTHROUGH_IOCTL. T...
```diff diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index fca6a8953070..d079f9a3c6b3 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -3871,6 +3871,9 @@ static long pmcraid_ioctl_passthrough( pmcraid_err("couldn't build passthrough ioadls\n"); goto out_free_buffer; } + } e...
17dd759c67f21e34f2156abcf415e1f60605a188
Analyze and fix the following issue in the Linux kernel code: gro: Only reset frag0 when skb can be pulled
Problem Details: Currently skb_gro_header_slow unconditionally resets frag0 and frag0_len. However, when we can't pull on the skb this leaves the GRO fields in an inconsistent state. This patch fixes this by only resetting those fields after the pskb_may_pull test. Signed-off-by: Herbert Xu <herbert@gondor.apana.org...
```diff diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 1d92acc0777b..661a07746e94 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1649,9 +1649,12 @@ static inline int skb_gro_header_hard(struct sk_buff *skb, unsigned int hlen) static inline void *skb_gro_header_slow...
db21b6f41bf5a9ce335ced4b5feaa0ad04327003
Analyze and fix the following issue in the Linux kernel code: [SCSI] megaraid_sas: Fix FastPath I/O to work on degraded raid 1
Problem Details: Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
```diff diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c index 8fe3a45794fc..5a5af1fe7581 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fp.c +++ b/drivers/scsi/megaraid/megaraid_sas_fp.c @@ -288,7 +288,6 @@ u8 MR_GetPhyParams(u32 ld, u64 stripRow, u16 stripRef, u64 *pdBlo...