forked from rpms/kernel
		
	3.1-rc3-git3 snapshot
This commit is contained in:
		
							parent
							
								
									04d46b9ad7
								
							
						
					
					
						commit
						28597795d3
					
				| @ -1,109 +0,0 @@ | |||||||
| commit 05511b61169da2f8dab464df61fa2bb952763a23 |  | ||||||
| Author: Josh Boyer <jwboyer@redhat.com> |  | ||||||
| Date:   Tue Aug 2 08:09:56 2011 -0400 |  | ||||||
| 
 |  | ||||||
|     usbnet/cdc_ncm: Don't use stack variables for DMA buffers |  | ||||||
|      |  | ||||||
|     The cdc_ncm driver still has a few places where stack variables are passed |  | ||||||
|     to the cdc_ncm_do_request function.  This triggers a stack trace in |  | ||||||
|     lib/dma-debug.c if the CONFIG_DEBUG_DMA_API option is set. |  | ||||||
|      |  | ||||||
|     Adjust these calls to pass parameters that have been allocated with kzalloc. |  | ||||||
|      |  | ||||||
|     Signed-off-by: Josh Boyer <jwboyer@redhat.com> |  | ||||||
| 
 |  | ||||||
| diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
 |  | ||||||
| index a03336e..f06fb78 100644
 |  | ||||||
| --- a/drivers/net/usb/cdc_ncm.c
 |  | ||||||
| +++ b/drivers/net/usb/cdc_ncm.c
 |  | ||||||
| @@ -228,23 +228,40 @@ static u8 cdc_ncm_setup(struct cdc_ncm_ctx *ctx)
 |  | ||||||
|  	if (ctx->rx_max != le32_to_cpu(ctx->ncm_parm.dwNtbInMaxSize)) { |  | ||||||
|   |  | ||||||
|  		if (flags & USB_CDC_NCM_NCAP_NTB_INPUT_SIZE) { |  | ||||||
| -			struct usb_cdc_ncm_ndp_input_size ndp_in_sz;
 |  | ||||||
| +			struct usb_cdc_ncm_ndp_input_size *ndp_in_sz;
 |  | ||||||
| +
 |  | ||||||
| +			ndp_in_sz = kzalloc(sizeof(*ndp_in_sz), GFP_KERNEL);
 |  | ||||||
| +			if (!ndp_in_sz) {
 |  | ||||||
| +				err = -ENOMEM;
 |  | ||||||
| +				goto size_err;
 |  | ||||||
| +			}
 |  | ||||||
| +
 |  | ||||||
|  			err = usb_control_msg(ctx->udev, |  | ||||||
|  					usb_sndctrlpipe(ctx->udev, 0), |  | ||||||
|  					USB_CDC_SET_NTB_INPUT_SIZE, |  | ||||||
|  					USB_TYPE_CLASS | USB_DIR_OUT |  | ||||||
|  					 | USB_RECIP_INTERFACE, |  | ||||||
| -					0, iface_no, &ndp_in_sz, 8, 1000);
 |  | ||||||
| +					0, iface_no, ndp_in_sz, 8, 1000);
 |  | ||||||
| +			kfree(ndp_in_sz);
 |  | ||||||
|  		} else { |  | ||||||
| -			__le32 dwNtbInMaxSize = cpu_to_le32(ctx->rx_max);
 |  | ||||||
| +			__le32 *dwNtbInMaxSize;
 |  | ||||||
| +			dwNtbInMaxSize = kzalloc(sizeof(*dwNtbInMaxSize),
 |  | ||||||
| +					GFP_KERNEL);
 |  | ||||||
| +			if (!dwNtbInMaxSize) {
 |  | ||||||
| +				err = -ENOMEM;
 |  | ||||||
| +				goto size_err;
 |  | ||||||
| +			}
 |  | ||||||
| +			*dwNtbInMaxSize = cpu_to_le32(ctx->rx_max);
 |  | ||||||
| +
 |  | ||||||
|  			err = usb_control_msg(ctx->udev, |  | ||||||
|  					usb_sndctrlpipe(ctx->udev, 0), |  | ||||||
|  					USB_CDC_SET_NTB_INPUT_SIZE, |  | ||||||
|  					USB_TYPE_CLASS | USB_DIR_OUT |  | ||||||
|  					 | USB_RECIP_INTERFACE, |  | ||||||
| -					0, iface_no, &dwNtbInMaxSize, 4, 1000);
 |  | ||||||
| +					0, iface_no, dwNtbInMaxSize, 4, 1000);
 |  | ||||||
| +			kfree(dwNtbInMaxSize);
 |  | ||||||
|  		} |  | ||||||
| -
 |  | ||||||
| +size_err:
 |  | ||||||
|  		if (err < 0) |  | ||||||
|  			pr_debug("Setting NTB Input Size failed\n"); |  | ||||||
|  	} |  | ||||||
| @@ -325,19 +342,29 @@ static u8 cdc_ncm_setup(struct cdc_ncm_ctx *ctx)
 |  | ||||||
|   |  | ||||||
|  	/* set Max Datagram Size (MTU) */ |  | ||||||
|  	if (flags & USB_CDC_NCM_NCAP_MAX_DATAGRAM_SIZE) { |  | ||||||
| -		__le16 max_datagram_size;
 |  | ||||||
| +		__le16 *max_datagram_size;
 |  | ||||||
|  		u16 eth_max_sz = le16_to_cpu(ctx->ether_desc->wMaxSegmentSize); |  | ||||||
| +
 |  | ||||||
| +		max_datagram_size = kzalloc(sizeof(*max_datagram_size),
 |  | ||||||
| +				GFP_KERNEL);
 |  | ||||||
| +		if (!max_datagram_size) {
 |  | ||||||
| +			err = -ENOMEM;
 |  | ||||||
| +			goto max_dgram_err;
 |  | ||||||
| +		}
 |  | ||||||
| +
 |  | ||||||
|  		err = usb_control_msg(ctx->udev, usb_rcvctrlpipe(ctx->udev, 0), |  | ||||||
|  				USB_CDC_GET_MAX_DATAGRAM_SIZE, |  | ||||||
|  				USB_TYPE_CLASS | USB_DIR_IN |  | ||||||
|  				 | USB_RECIP_INTERFACE, |  | ||||||
| -				0, iface_no, &max_datagram_size,
 |  | ||||||
| +				0, iface_no, max_datagram_size,
 |  | ||||||
|  				2, 1000); |  | ||||||
|  		if (err < 0) { |  | ||||||
|  			pr_debug("GET_MAX_DATAGRAM_SIZE failed, use size=%u\n", |  | ||||||
|  						CDC_NCM_MIN_DATAGRAM_SIZE); |  | ||||||
| +			kfree(max_datagram_size);
 |  | ||||||
|  		} else { |  | ||||||
| -			ctx->max_datagram_size = le16_to_cpu(max_datagram_size);
 |  | ||||||
| +			ctx->max_datagram_size =
 |  | ||||||
| +				le16_to_cpu(*max_datagram_size);
 |  | ||||||
|  			/* Check Eth descriptor value */ |  | ||||||
|  			if (eth_max_sz < CDC_NCM_MAX_DATAGRAM_SIZE) { |  | ||||||
|  				if (ctx->max_datagram_size > eth_max_sz) |  | ||||||
| @@ -360,8 +387,10 @@ static u8 cdc_ncm_setup(struct cdc_ncm_ctx *ctx)
 |  | ||||||
|  						USB_TYPE_CLASS | USB_DIR_OUT |  | ||||||
|  						 | USB_RECIP_INTERFACE, |  | ||||||
|  						0, |  | ||||||
| -						iface_no, &max_datagram_size,
 |  | ||||||
| +						iface_no, max_datagram_size,
 |  | ||||||
|  						2, 1000); |  | ||||||
| +			kfree(max_datagram_size);
 |  | ||||||
| +max_dgram_err:
 |  | ||||||
|  			if (err < 0) |  | ||||||
|  				pr_debug("SET_MAX_DATAGRAM_SIZE failed\n"); |  | ||||||
|  		} |  | ||||||
| @ -51,7 +51,7 @@ Summary: The Linux kernel | |||||||
| # For non-released -rc kernels, this will be prepended with "0.", so | # For non-released -rc kernels, this will be prepended with "0.", so | ||||||
| # for example a 3 here will become 0.3 | # for example a 3 here will become 0.3 | ||||||
| # | # | ||||||
| %global baserelease 1 | %global baserelease 0 | ||||||
| %global fedora_build %{baserelease} | %global fedora_build %{baserelease} | ||||||
| 
 | 
 | ||||||
| # base_sublevel is the kernel version we're starting with and patching | # base_sublevel is the kernel version we're starting with and patching | ||||||
| @ -84,7 +84,7 @@ Summary: The Linux kernel | |||||||
| # The rc snapshot level | # The rc snapshot level | ||||||
| %define rcrev 3 | %define rcrev 3 | ||||||
| # The git snapshot level | # The git snapshot level | ||||||
| %define gitrev 0 | %define gitrev 3 | ||||||
| # Set rpm version accordingly | # Set rpm version accordingly | ||||||
| %define rpmversion 3.%{upstream_sublevel}.0 | %define rpmversion 3.%{upstream_sublevel}.0 | ||||||
| %endif | %endif | ||||||
| @ -711,7 +711,6 @@ Patch12016: disable-i8042-check-on-apple-mac.patch | |||||||
| 
 | 
 | ||||||
| Patch12021: udlfb-bind-framebuffer-to-interface.patch | Patch12021: udlfb-bind-framebuffer-to-interface.patch | ||||||
| 
 | 
 | ||||||
| Patch12022: fix-cdc-ncm-dma-stack-vars.patch |  | ||||||
| Patch12023: ums-realtek-driver-uses-stack-memory-for-DMA.patch | Patch12023: ums-realtek-driver-uses-stack-memory-for-DMA.patch | ||||||
| Patch12024: epoll-fix-spurious-lockdep-warnings.patch | Patch12024: epoll-fix-spurious-lockdep-warnings.patch | ||||||
| Patch12025: rcu-avoid-just-onlined-cpu-resched.patch | Patch12025: rcu-avoid-just-onlined-cpu-resched.patch | ||||||
| @ -1339,7 +1338,6 @@ ApplyPatch disable-i8042-check-on-apple-mac.patch | |||||||
| ApplyPatch add-appleir-usb-driver.patch | ApplyPatch add-appleir-usb-driver.patch | ||||||
| 
 | 
 | ||||||
| ApplyPatch udlfb-bind-framebuffer-to-interface.patch | ApplyPatch udlfb-bind-framebuffer-to-interface.patch | ||||||
| ApplyPatch fix-cdc-ncm-dma-stack-vars.patch |  | ||||||
| ApplyPatch ums-realtek-driver-uses-stack-memory-for-DMA.patch | ApplyPatch ums-realtek-driver-uses-stack-memory-for-DMA.patch | ||||||
| ApplyPatch epoll-fix-spurious-lockdep-warnings.patch | ApplyPatch epoll-fix-spurious-lockdep-warnings.patch | ||||||
| ApplyPatch rcu-avoid-just-onlined-cpu-resched.patch | ApplyPatch rcu-avoid-just-onlined-cpu-resched.patch | ||||||
| @ -2074,6 +2072,9 @@ fi | |||||||
| #                 ||----w | | #                 ||----w | | ||||||
| #                 ||     || | #                 ||     || | ||||||
| %changelog | %changelog | ||||||
|  | * Thu Aug 25 2011 Josh Boyer <jwboyer@redhat.com> | ||||||
|  | - Linux 3.1-rc3-git3 | ||||||
|  | 
 | ||||||
| * Wed Aug 24 2011 Josh Boyer <jwboyer@redhat.com> | * Wed Aug 24 2011 Josh Boyer <jwboyer@redhat.com> | ||||||
| - Revert 'iwlwifi: advertise max aggregate size'. (rhbz 708747) | - Revert 'iwlwifi: advertise max aggregate size'. (rhbz 708747) | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user