From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ni.piap.pl ([195.187.100.4]:33098 "EHLO ni.piap.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751975AbdELEju (ORCPT ); Fri, 12 May 2017 00:39:50 -0400 From: khalasa@piap.pl (Krzysztof =?utf-8?Q?Ha=C5=82asa?=) To: Ezequiel Garcia Cc: linux-media , zhaoxuegang Subject: Re: [PATCH] TW686x: Fix OOPS on buffer alloc failure References: <590ADAB1.1040501@suntec.net> Date: Fri, 12 May 2017 06:39:47 +0200 In-Reply-To: (Ezequiel Garcia's message of "Thu, 11 May 2017 13:04:42 -0300") Message-ID: MIME-Version: 1.0 Content-Type: text/plain Sender: linux-media-owner@vger.kernel.org List-ID: Ezequiel Garcia writes: > How about this one (untested) ? > > diff --git a/drivers/media/pci/tw686x/tw686x-video.c > b/drivers/media/pci/tw686x/tw686x-video.c > index c3fafa97b2d0..77b8d2dbd995 100644 > --- a/drivers/media/pci/tw686x/tw686x-video.c > +++ b/drivers/media/pci/tw686x/tw686x-video.c > @@ -86,6 +86,9 @@ static void tw686x_memcpy_dma_free(struct > tw686x_video_channel *vc, > struct pci_dev *pci_dev; > unsigned long flags; > > + /* Make sure this channel is initialized */ > + if (!dev) > + return; Whatever you wish. Just make sure it doesn't bomb out by default, when one happens to have such a card in his or her machine. -- Krzysztof Halasa Industrial Research Institute for Automation and Measurements PIAP Al. Jerozolimskie 202, 02-486 Warsaw, Poland