Thomas Jarosch
2011-Aug-27 23:03 UTC
[Nut-upsdev] [PATCH 3/3] Fix pointer check on wrong variable
Credit goess to "cppcheck" Signed-off-by: Thomas Jarosch <thomas.jarosch at intra2net.com> --- drivers/usb-common.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/usb-common.c b/drivers/usb-common.c index e51f3cf..e459872 100644 --- a/drivers/usb-common.c +++ b/drivers/usb-common.c @@ -116,7 +116,7 @@ int USBNewExactMatcher(USBDeviceMatcher_t **matcher, USBDevice_t *hd) USBDevice_t *data; m = malloc(sizeof(*m)); - if (!matcher) { + if (!m) { return -1; } -- 1.7.4.4
EmilienKia at Eaton.com
2011-Aug-31 14:01 UTC
[Nut-upsdev] [PATCH 3/3] Fix pointer check on wrong variable
Hi Thomas> -----Message d'origine----- > De : > nut-upsdev-bounces+emilienkia=eaton.com at lists.alioth.debian.or > g > [mailto:nut-upsdev-bounces+emilienkia=eaton.com at lists.alioth.d > ebian.org] De la part de Thomas Jarosch > Envoy? : dimanche 28 ao?t 2011 01:04 > ? : nut-upsdev at lists.alioth.debian.org > Objet : [Nut-upsdev] [PATCH 3/3] Fix pointer check on wrong variable > > Credit goess to "cppcheck" > > Signed-off-by: Thomas Jarosch <thomas.jarosch at intra2net.com> > --- > drivers/usb-common.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/usb-common.c b/drivers/usb-common.c > index e51f3cf..e459872 100644 > --- a/drivers/usb-common.c > +++ b/drivers/usb-common.c > @@ -116,7 +116,7 @@ int USBNewExactMatcher(USBDeviceMatcher_t > **matcher, USBDevice_t *hd) > USBDevice_t *data; > > m = malloc(sizeof(*m)); > - if (!matcher) { > + if (!m) { > return -1; > } > > -- > 1.7.4.4 >Thanks for your patch. I have just applied it to the trunk (r3173). Best regards Emilien KIA Opensource Team Engineering Software & Connectivity Eaton's Electrical Group PQCO/DPQD emilienkia at eaton.com www.eaton.com --------------------------------------------------------------------------