From patchwork Thu Oct 13 16:47:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9375479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0E42A60487 for ; Thu, 13 Oct 2016 16:50:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8A7C28AF5 for ; Thu, 13 Oct 2016 16:50:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9B72284E7; Thu, 13 Oct 2016 16:50:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DAFD200E7 for ; Thu, 13 Oct 2016 16:50:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932562AbcJMQui (ORCPT ); Thu, 13 Oct 2016 12:50:38 -0400 Received: from mout.web.de ([212.227.15.14]:55147 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752030AbcJMQuh (ORCPT ); Thu, 13 Oct 2016 12:50:37 -0400 Received: from [192.168.1.2] ([77.182.72.22]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0LiFT1-1b7Jaz2cHD-00nQfs; Thu, 13 Oct 2016 18:47:06 +0200 Subject: [PATCH 17/18] [media] RedRat3: Adjust two checks for null pointers in redrat3_dev_probe() To: linux-media@vger.kernel.org, Hans Verkuil , Mauro Carvalho Chehab , Sean Young , Wolfram Sang References: <566ABCD9.1060404@users.sourceforge.net> <81cef537-4ad0-3a74-8bde-94707dcd03f4@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <810dec6f-8c5e-6784-bdc0-a9bed477b8c4@users.sourceforge.net> Date: Thu, 13 Oct 2016 18:47:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <81cef537-4ad0-3a74-8bde-94707dcd03f4@users.sourceforge.net> X-Provags-ID: V03:K0:zl1v6DBeurHgJdezIFZaFQOrsFLabflNkFLl/mkDcrOJaeJvzQB rZc5qRNLdeqhspfiBNajlzmMIcsKCCOUU5dDYZko3HeP7ksgPlpsv4YwIXG4NcyrVVKjT1b 5UZ7qEwXFPdxrNThFl+IoCqX18p4CJQMQet7ND0NOOEf1E0wL7ib4XefRY4upWgP20ms8Z3 YrTr7O1bRcDkF28L5xGRg== X-UI-Out-Filterresults: notjunk:1; V01:K0:DpIxqbG7BAA=:Qw11prezzIHXjNhmH9tdXg o5pjQ68NFU/WCKkE5ZEEvxnxTZ/AhrgeOa0k1WpeCLZnWWkfAnM+JPJpr3d+/EFZNoE3201eb AqW0BcIZVjZvZzUlAVkoyy2Ya8rlR97GyOGFAmRxABqQYmRvHNlpqBo4cCuNdgUP3DinUAsHy PTCpLH0oBsmg2XxVB4BA6aDEwAUWZ1cgOReUmUPWGeqRBumcybMWIXWa7a8Jax4WFJNb2MNEx Uv6h5Na8929T/eEZdWM/JJZER4mjYsZTmi354MyLXJDUm6CQuO35b8UNiNJylrUf5637xFLfT w/B0+y/On7IG7kENjGNS43+1ePXBWCyM1QfVUp1Jk0bnkAl4CRCAcqHfl2WpgBqbP5S7QMfjm 3wZ8VD5fMwupb8+IiTMKuzUpMNgED/gKcDCwDdAk5jSQ03Zy928/eJ4UsRvMfUdqE0GdhXmag aM71w+NcbJ4utGrD5HNKEgAtfW3C86NCszCHdP+bzP+4PnbExOf5r56h4Z+Wx+SvIUkefuxVd AIllZiBuwFKOGgotJqYri/rB1T2q6H3K9WYQ0oyDaJo6xrcIsQiluy8q7kYIk5gEdrWZKXO6b +/fg4nKwuAtlRFuIkYx6rufhnk/HJzdC+TQstPVZVwEddqR8jLiS9SyVqKhy8mFKdybhxsKdO 8AATTTpyA/bfSKJYgnMDdZogbT5eWwSqL8U36C+CgB2t7sLfvJqyghh/Wf0/FRvL9l7QuLwUY 5WTZ4a/pK7Ahj02BjMgu5zVx2K6yOVLTPojeXDv8l/cZvEoDpASJSs8eeUgtKwIZRJ3qbMX5R 5vT6O0x Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Thu, 13 Oct 2016 17:40:34 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script "checkpatch.pl" pointed information out like the following. Comparison to NULL could be written !… Thus fix the affected source code places. Signed-off-by: Markus Elfring --- drivers/media/rc/redrat3.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c index 06c9eea..a09d5cb 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c @@ -923,8 +923,7 @@ static int redrat3_dev_probe(struct usb_interface *intf, ep = &uhi->endpoint[i].desc; addr = ep->bEndpointAddress; attrs = ep->bmAttributes; - - if ((ep_in == NULL) && + if (!ep_in && ((addr & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) && ((attrs & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK)) { @@ -935,7 +934,7 @@ static int redrat3_dev_probe(struct usb_interface *intf, ep_in = ep; } - if ((ep_out == NULL) && + if (!ep_out && ((addr & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) && ((attrs & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK)) {